Problem
The error “ Timed out - script took longer than 5 minutes to run." indicates that the Lua script exceeded the execution time limit.
Cause
The Lua script exceeded the default maximum execution time of 300 seconds, resulting in the error.
This occurred because the script performed operations that required more time than the allowed execution limit, causing the runtime to terminate the script before completion.
Solution
Increase the script execution timeout using component.setScriptTimeout(seconds) in your script to allow sufficient time for the script to complete.
component.setScriptTimeout(400)
Notes:
-
This function sets the timeout only for the current script execution.
-
It has no effect when the script runs inside the editor (only active in production).
-
If you know a task may take longer than usual, increase the timeout to avoid premature script termination.
-
Be mindful that very long timeouts can cause stalled or stuck components if an issue arises.