Maximum call stack size exceeded

In App Health I have an error that is hard to track down and is causing the app to malfunction.

Maximum call stack size exceeded

name

“RangeError”

stack

“RangeError: Maximum call stack size exceeded\n at /usr/src/app/server/src-common/lib/modelUtils/modelInflator_v3/primitiveInflators/componentContainerInflator.js:46:25\n at Array.forEach ()\n at mergeValues (/usr/src/app/server/src-common/lib/modelUtils/modelInflator_v3/primitiveInflators/componentContainerInflator.js:42:28)\n at addStatsToView (/usr/src/app/server/src-common/lib/modelUtils/modelInflator_v3/primitiveInflators/componentContainerInflator.js:74:17)\n at componentContainerInflator (/usr/src/app/server/src-common/lib/modelUtils/modelInflator_v3/primitiveInflators/componentContainerInflator.js:119:5)\n at /usr/src/app/server/src-common/lib/modelUtils/modelInflator_v3/inflateAndAnalyzeSingleView.js:75:84\n at Array.reduce ()\n at inflateAndAnalyzeSingleView (/usr/src/app/server/src-common/lib/modelUtils/modelInflator_v3/inflateAndAnalyzeSingleView.js:59:67)\n at /usr/src/app/server/src-client-service/dist/src/controllers/AppController.js:788:57\n at Array.forEach ()”

Hi,

I´ve seen this happen in apps with Shareable Components. Do you have many Shareable Components in your app?

Thanks :slightly_smiling_face:

// Erik

Yeah, just started using it - only got two now.

A fix for this issue is under development :smiling_face:

// Erik

1 Like

Ok, is it related to function params?

It is not directly related to function params, but in both cases when I observed this, I had Shareable Components with them.
So it might be related.

// Erik

I managed to reproduce it:

If I simply duplicated ‘Stats - Row’ the error appears. Funny thing is if I remove the dupe the error is still there. If I remove the remaining ‘Stats - Row’, the error disappears. Very strange…

Hi,

109 should contain a fix for this issue. It was released just recently. Do you still have the same issue?

// Erik

Awesome! That fixed the call stack issue. However I got a new issue :sweat_smile:

This works:

But this does not work:

image

This will throw this error in App Validation:

Ps. The ‘Stats - Activity Bookings’ / statsActivityBookings data source is disabled by default and enabled in the ‘On View Load’ event.

Can you send a screenshot of your function, and the filter on the function params?
Seems like a filter on statsActivityBooking is failing.

// Erik

Returning a plain number from a function works fine. Could be something when accessing the data source as you mention:

Hi!

I believe I recreated it:

Component param Current is an integer, being sent into to component, calculated with a function containing function params.

Inside the Component, you have a Filter, e.g. My datasource.Maxnumber > Current
→ That fails, having Current on the right side of a filter inside the Component, when Current is a function with function parameters (that parsing fails “inception-style” as a JSON with function with a function as function value is generated client side when the filter is parsed).

Registering an issue on this one, but I guess you may workaround it somehow.

Yes, I have conditional visibility on the increase / decrease indicator icons using current and previous:

Removing that visibility condition makes the error go away.

1 Like

Also, using a function instead of a condition to determine visibility works.