How to debug a maximum call stack size error in Unity 3D WebGL?

Viewed 3873

I'm having this weird issue when exporting my Unity 3D application to webGL. On my computer it runs fine (on Unity, that is) but when I put it online it gives me the Maximum Call Stack Size error on Chrome (firefox runs fine) I did some research and most articles say it's because of a possible infinite loop on the code, I checked my code and there are no infinite loops (it would hang on firefox). So now I'm not sure how can I debug this. Can someone help out?

Update: I tried disabling objects from the scene, and even with an almost empty scene with no C# code running, it will still return this bug.

3 Answers

I had this error. I was able to fix it by just refreshing the browser cache. Ctrl-Shift-R wasn't enough on Firefox. I had to go into network console enable "Disable Cache" there.

Using latest Unity 2018.1.0f2 Personal this was happening. File --> Build Settings --> WebGL --> Player Settings - select WebGL Build. Then on the inspector tab changed the Api Compatibility Level from 4.x to .Net Standard 2.0. All working now.

Error in Chrome

Uncaught RangeError : Maximum Call Stack Size Exceeded

Error in Firefox

Too much Recursion.

Unity WebGL panel

Thanks @slaw. It did not work for me by refreshing, but when I opened it in an Incognito mode, the error was gone.

Related