After Defold is open for a few hours the build is unable to create resources

After leaving the editor open for some time and then coming back and trying to build the project, when trying to open the main collection the game cuts to black and the sonsole returns the following error relating to self:
main/UI/stats.gui_script:36: attempt to index global ‘self’ (a nil value)
stack traceback:
main/UI/stats.gui_script:36: in main chunk

However, when changed or removed, Any other time ‘self.’ is used it is recognised as a nil global variable and returns a similar error.
This is followed by the engine being unable to create any resources:

The “Unable to create resource” bit always happens when the init function of a script throws an error. Can you share more of your stats.gui_script file?

Sure


Please let me know if theres any more information I can provide

It looks like you have an extra end on line 34, so the code after that is actually outside of the update function.

3 Likes