# HomeyScript, “RangeError: Maximum call stack size exceeded” exact every 10 minutes

**URL:** <https://community.homey.app/t/homeyscript-rangeerror-maximum-call-stack-size-exceeded-exact-every-10-minutes/146939>\
**Category:** Questions & Help\
**Created:** [December 15, 2025, 8:42am UTC](https://community.homey.app/t/homeyscript-rangeerror-maximum-call-stack-size-exceeded-exact-every-10-minutes/146939 "2025-12-15T08:42:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freek\_Smits](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/freek_smits/32/33854_2.png) [@Freek\_Smits](https://community.homey.app/u/Freek_Smits)\
**Post date:** [December 15, 2025, 8:42am UTC](https://community.homey.app/t/homeyscript-rangeerror-maximum-call-stack-size-exceeded-exact-every-10-minutes/146939/1 "2025-12-15T08:42:46Z")

</div>

Since approximately November 20th, I’ve been experiencing an issue where the Homey Script App frequently crashes. This starts occurring just 15-30 minutes after a cold restart (PTP) of the Homey Pro 2023. After the HomeyScript App crashes and is restarted, it works correctly for another 5-15 minutes. With every subsequent restart of the HomeyScript App, the crash happens faster, until a call to a HomeyScript Flow card returns the message “Not Enough Memory Left To Start App,” at which point the Homey Pro needs to be restarted again.  
In the past few days, I have replaced or disabled many HomeyScript flow cards with an alternative. Errors related to memory or CPU usage no longer occur. I am now only left with the following RangeError.  
The strange thing is that this error occurs at an exact 10-minute interval, for example: 14-12-2025 22:30:00 and 14-12-2025 22:40:00. I can no longer find a time-based trigger in my Flows that could cause this (I have changed all occurrences of 10 minutes to a different value). I also checked all larger HomeyScripts for recursion and manually started all Flows containing a HomeyScript Flow card, hoping a fault would occur within the 10-minute interval. Unfortunately, this yielded no results.  
I have extensive logging via the Easy Logger App. I cannot find any suspicious calls between two error messages either.

Error occurring every 10 minutes:  
RangeError: Maximum call stack size exceeded  
at [nodejs.internal.kHybridDispatch] (node:internal/event\_target:853:9)  
at WebSocket.dispatchEvent (node:internal/event\_target:778:26)  
at fireEvent (node:internal/deps/undici/undici:11853:14)  
at failWebsocketConnection (node:internal/deps/undici/undici:11934:9)  
at closeWebSocketConnection (node:internal/deps/undici/undici:12205:9)  
at WebSocket.close (node:internal/deps/undici/undici:12866:9)  
at WS.doClose (/app/node\_modules/engine.io-client/lib/transports/websocket.js:248:13)  
at Transport.close (/app/node\_modules/engine.io-client/lib/transport.js:98:10)  
at Socket.onClose (/app/node\_modules/engine.io-client/lib/socket.js:713:20)  
at Socket.onError (/app/node\_modules/engine.io-client/lib/socket.js:691:8)

The error message suggests infinite recursion in a HomeyScript, possibly in combination with a Flow. Does anyone have an idea how I can find the cause of this error with an exact 10-minute interval?

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [December 15, 2025, 9:00am UTC](https://community.homey.app/t/homeyscript-rangeerror-maximum-call-stack-size-exceeded-exact-every-10-minutes/146939/2 "2025-12-15T09:00:11Z")

</div>

I was getting the stack overflow errors in my apps that used the Homey api library after about the same time. To fix it, I had to update my apps to use the latest Homey api library and publish them again. Maybe it’s related, so contact Athom to see if they can fix it.
