# Maximum call stack size exceeded

**URL:** <https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491>\
**Category:** Bug reports\
**Created:** [November 5, 2024, 2:55pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491 "2024-11-05T14:55:16Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 5, 2024, 2:55pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/1 "2024-11-05T14:55:16Z")

</div>

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 ()”

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [November 5, 2024, 3:12pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/2 "2024-11-05T15:12:10Z")

</div>

Hi,

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

Thanks 🙂

// Erik

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 5, 2024, 3:13pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/3 "2024-11-05T15:13:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [November 5, 2024, 3:17pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/4 "2024-11-05T15:17:02Z")

</div>

A fix for this issue is under development ☺

// Erik

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 5, 2024, 3:20pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/5 "2024-11-05T15:20:06Z")

</div>

Ok, is it related to function params?

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [November 5, 2024, 3:26pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/6 "2024-11-05T15:26:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 5, 2024, 3:31pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/7 "2024-11-05T15:31:34Z")

</div>

I managed to reproduce it:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/6/6888ed294dc8415a0acc648ffdc38dc6b7e0d64c.png)

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…

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [November 5, 2024, 8:28pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/8 "2024-11-05T20:28:50Z")

</div>

Hi,

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

> [@Release Notes 109](https://community.appfarm.io/t/release-notes-109/1490):
>
> We have reached November and it’s time for release 109! This release includes several enhancements and fixes, mainly focusing on shareable components: Implemented support for filtering reference-type component params in the function editor Implemented tree structure for component params in function editor to harmonize UI with data sources Added access to builtin properties for reference-type component params The full list of improvements, news and bug fixes can be found below. What’s New Su…

// Erik

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 5, 2024, 9:21pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/9 "2024-11-05T21:21:31Z")

</div>

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

This works:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/8/8bc2855a906f4fc22ddebc57146b6b762c80156c.png)

But this does not work:

![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/3/385accb0e6f39650e89ae4493f5b36d098c6b196.png)

This will throw this error in App Validation:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/d/d70f04ff5bc9441498287454b76d1812d8ad85b8.png)

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

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [November 6, 2024, 9:33am UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/10 "2024-11-06T09:33:57Z")

</div>

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

// Erik

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 6, 2024, 11:57am UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/11 "2024-11-06T11:57:55Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/1/136bdac29784f233f7b063e8cfa2ce07fc674c82.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/a/aecadf2cd3459e241162797c57af0249036e5ab2.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/f/f0e3e0a5ecf6d5331e00ab754be21dd56092f9f8.png)

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [November 6, 2024, 12:40pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/12 "2024-11-06T12:40:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 6, 2024, 12:54pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/13 "2024-11-06T12:54:18Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/b/be4960266af974c558efec52e7b08a9c469bc704.png)

Removing that visibility condition makes the error go away.

---

<div class="post-metadata">

**Author:** ![kenneth.solberg](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kenneth.solberg/32/1034_2.png) [@kenneth.solberg](https://community.appfarm.io/u/kenneth.solberg)\
**Post date:** [November 6, 2024, 1:42pm UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/14 "2024-11-06T13:42:04Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/5/51916fe6ee6f99f4ad32c2864a98d4c8744d3c82.png)

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [January 23, 2025, 7:56am UTC](https://community.appfarm.io/t/maximum-call-stack-size-exceeded/1491/15 "2025-01-23T07:56:04Z")

</div>

Hi!

This bug has been fixed in [Release 112](https://community.appfarm.io/t/release-notes-112/1600).
