RangeError: Maximum call stack size exceeded at Array.<anonymous>

I’m having a strange issue that only occurs in a production build where the application.hbs file is getting rendered multiple times causing a stack overflow.

The full error log is:

Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at Array.<anonymous> (index.js:7592:1)
    at W._trigger (backburner.js:1082:1)
    at W._end (backburner.js:977:1)
    at W.end (backburner.js:708:1)
    at W._run (backburner.js:1007:1)
    at W._join (backburner.js:987:1)
    at W.join (backburner.js:758:1)
    at Array.<anonymous> (index.js:7597:1)
    at W._trigger (backburner.js:1082:1)
    at W._end (backburner.js:977:1)

I can’t pinpoint where the actual issue is, although have been able to reproduce it locally using ember s --environment=production.

Does anyone have any ideas about where I might start debugging this issue?

Weirdest bug I’ve ever encountered. The culprit was the ember-intl package and the htmlSafe var on a {{t htmlSafe=true}} input.

Behaviour was inconsistent between branches so no way to reliably debug it. In the end I went through the template that was failing commenting code until I found it. Quite frustrating and more than a little concerning given I couldn’t work out what was different.

Error messaging was next to useless.

Wow that’s a weird one. What versions of ember-source and ember-intl are you on, our of curiosity?

Our codebase is relatively up to date and we upgrade to LTS versions as soon as possible. About 80% test coverage too and all those tests pass.

We’ve recently upgraded to 3.28 and upgraded node -v from 12 to 14 at the same time.

“ember-source”: “~3.28.0”, “ember-intl”: “^5.7.2”,

So just to shine a bit more light on this for anyone reading. This bug was to do with Ember Engines and mismatched ember-intl package versions. Some of the older engines were running v4 packages, and there was likely some sort of conflict happening in node_modules.

Was difficult to debug due to the error messaging and the problem appearing in the core app where packages were up to date.

1 Like