Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Randomly getting Maximum Call Stack Size Exceeded in zone.js

Tags:

angular

We're using Bugsnag and randomly I see this error in our logs

error

We're on Angular 6.1.1, and we're using production build with optimization and build-optimization enabled. Using zone.js 0.8.26 which is currently latest version.

How can I debug this?

like image 394
Boland Avatar asked Aug 10 '18 01:08

Boland


People also ask

How do I fix error in maximum call stack size exceeded?

The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is not being met and is, therefore, calling the function again and again until you hit the call stack limit.

How do I fix maximum call stack size exceeded see JavaScript console for details?

The "RangeError: Maximum call stack size exceeded" error occurs when a function is called so many times that the invocations exceed the call stack limit. To solve the error, specify a base case that has to be met to exit the recursion.

What does it mean when maximum call stack size exceeded?

The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" occurs when there are too many function calls, or a function is missing a base case.

What is the maximum call stack size in JS?

The consequences of applying a function with too many arguments (think more than tens of thousands of arguments) vary across engines (JavaScriptCore has hard-coded argument limit of 65536), because the limit (indeed even the nature of any excessively-large-stack behavior) is unspecified.


1 Answers

You have to find a way to reproduce this error, after that you can try to downgrade zone.js version, try to temporary remove third party libraries (WS libraries, bugsnap itself, all other libraries that might be using advanced browser features and prototype patches), ensure that zone.js is loaded first, relax uglify-js settings. Also you may be interested in https://github.com/angular/zone.js/issues/900.

like image 156
kemsky Avatar answered Sep 21 '22 05:09

kemsky