Unable to Run webgl Component on localhost

Hi,

After upgrading to unity 5.4.0f3 my webgl builds are not working im getting following error

I’m not sure what the problem is can anyone provide me with proper guidance

Thanks in advance

Anyone else facing the same problem??

will be glad if anyone can guide me in the correct direction

Thanks

After debugging the code step by step in browser I found out the real reason for it to break.
Issue was caused by following line of code System.GC.Collect(1);

I’m not sure why the previous developer was playing around with garbage collection specially in update.

If anyone finds them self facing the same problem make sure you are not performing any operation specially wrt GC.

This fixed the same issue I was having. Thank you for posting your solution!

Can someone from Unity explain why these calls are broken in 5.4.x? They were working in 5.3.5f1

We only support zero as a parameter:
System.GC.Collect(0);

However, it is not supposed to crash. Would you mind submitting a bug report ?

Hi Marco, as of now I cannot share the code base due to the product confidentiality bonds.

If time permits, will see what i can do to reproduce it in some dummy project.

Thanks for the help :slight_smile:

I can’t for the same reason, also in crunch now and just don’t have the time to do a full bug report with a stripped project.

If it helps it was being called in a co-routine just after yield return new WaitForEndOfFrame(); and it was on a webGL build.

We were also using GC.Collect(2);

No worries, it was super easy to repro so I submitted one myself.