Maximum call stack size Exceeded

I have a dashboard with 2 charts and whenever I open it, I am getting ‘Maximum call stack size Exceeded’ error. Many times tab freezes as well. I am running Metabase 0.31.2

Console Error:
DEPRECATED: metabase/redux/metadata fetchDatabaseMetadata
v @ app-main.bundle.js?78262faa1c529a733077:5
app-main.bundle.js?78262faa1c529a733077:5 RangeError: Maximum call stack size exceeded
at t.value (app-main.bundle.js?78262faa1c529a733077:5)
at u._renderValidatedComponentWithoutOwnerOrContext (vendor.bundle.js?78262faa1c529a733077:145)
at u._renderValidatedComponent (vendor.bundle.js?78262faa1c529a733077:145)
at u._updateRenderedComponent (vendor.bundle.js?78262faa1c529a733077:145)
at u._performComponentUpdate (vendor.bundle.js?78262faa1c529a733077:145)
at updateComponent (vendor.bundle.js?78262faa1c529a733077:145)
at u.receiveComponent (vendor.bundle.js?78262faa1c529a733077:145)
at Object.receiveComponent (vendor.bundle.js?78262faa1c529a733077:83)
at u._updateRenderedComponent (vendor.bundle.js?78262faa1c529a733077:145)
at u._performComponentUpdate (vendor.bundle.js?78262faa1c529a733077:145)
(anonymous) @ app-main.bundle.js?78262faa1c529a733077:5

Possibly related issue reported on GitHub:

As you can see from that issue it was apparently only reporoducible in Chrome, and under sertaion circumstances.

Please look through that issue and what was tried to reproduce - than give give as much relevant info (browser, did you also zoom, etc etc.), so someone can hopefully reproduce. Otherwise there’s a slim chance to nail this bug.

This error is almost always means you have a problem with recursion in JavaScript code, as there isn’t any other way in JavaScript to consume lots of stack. Sometimes calling a recursive function over and over again, causes the browser to send you Maximum call stack size exceeded error message as the memory that can be allocated for your use is not unlimited.

Be considerate while calling functions , also dry run is the best practice to prevent them. It’s possible to cause infinite recursion in a fully promisified code, too. That can happen if the promises in a chain don’t actually perform any asynchronous execution , in which case control never really returns to the event loop, even though the code otherwise appears to be asynchronous. That’s when it’s useful to wrap your recursive function call into a -

  • setTimeout
  • setImmediate or
  • process.nextTick

In some programming languages this can be solved with tail call optimization, where the recursion call is transformed under the hood into a loop so no maximum stack size reached error exists.