I am running a homeyscript, approx 300 lines of code. I can see in the memory and cpu insight of the script application that these are increasing over time until the entire homeyscript app is hanging and I need to restart. Any ideas how to overcome this? Feels dreastic to restart the script app every hour.
This usually points to a memory leak or uncontrolled growth in the script. Common causes are unbounded arrays/objects, intervals or timeouts that are created but never cleared, or repeated event listeners being registered. Make sure the script finishes cleanly, avoid global state that keeps growing, clear timers/listeners, and consider splitting long-running logic into smaller scripts or flows. Continuous scripts aren’t ideal for HomeyScript.
Your LLM is hallucinating.
1 Like
Maybe it’s possible to upgrade the library here?
Maybe npm install homey-api@latest will work here?