Troubleshooting Uncaught RangeError: Maximum call stack size exceeded

3.4k views Asked by At

I am getting this error only in Safari and Chrome on Mac machine, but can't reproduce on other browsers nor on Windows. The main problem - there is no information on what function caused the issue. No stack trace with most recent calls before the exception. And even the "Pause on exceptions" setting is not working. It's not paused on this exception, only puts the information to console.

How can I troubleshoot what is causing the issue, on what function it crashes, what was the call stack before crash? Or how can I log all the function calls(important note, the profiler should be started immediately after page load).

1

There are 1 answers

0
Serhiy On

I have managed to find the point that was causing the error, so here are some advises for those who will face a same issue:

  • console.log is your friend. I haven't found an option in Google chrome that will trace all methods calls starting immediately after page load. Even if there is such setting, the amount of calls you will see maybe really massive. So you can use console.log to log whenever one of your functions called.
  • Commenting out parts of the code. In my case the js file was really huge and it was helpfull to find at least the part of the code that was causing an error. So I started by safelly commenting out the code piece by piece.
  • Using technichs above I have found that the issue appeared in the obfuscated code, so next thing I tried was disabling obfuscation options one by one. With this approach I have found that issue appeared when enabling 'string splitting' obfuscation option. Also I have found these issues on a code.google.com chromium 446047 and 56588.