I have been working on a Bangle.js app for work. After leaving the code to run for a while, the app starts throwing errors continually (probably once every time some event is fired). The errors thrown were very peculiar to me. For example in latest build:
Uncaught ReferenceError: "ointStep" is not defined
at line 1 col 1
ointStep(){var
^
in function called from system
(where the function in question is supposed to be notifyCheckpointStep(), is not even a function call but rather a method definition within a class, and is most certainly not at line 1 column 1)
and
Uncaught SyntaxError: Unexpected end of Input
at line 1 col 30
t c=0;const l={normal:1,move
It almost seems like Espruino is reading the program as a 30-byte fragment of the full program, and crashing because the resulting syntax within the fragment is invalid.
We know for a fact that the program file itself is intact, as resetting the Bangle and starting the app again works fine (until a few minutes later when it starts throwing the exact same errors again).
For context, the program uses a relatively large amount of RAM, with only less than 300 blocks left out of the usable 2100 blocks, and that's when no function is running and everything is just waiting for events. I don't know exactly how much memory is used at maximum. We have already run into other problems caused by low free memory (which fortunately we have managed to work around) so I hope this is not yet another one of them.
May I ask what causes this, and how we could solve this problem? Thank you.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have been working on a Bangle.js app for work. After leaving the code to run for a while, the app starts throwing errors continually (probably once every time some event is fired). The errors thrown were very peculiar to me. For example in latest build:
(where the function in question is supposed to be
notifyCheckpointStep()
, is not even a function call but rather a method definition within a class, and is most certainly not at line 1 column 1)and
It almost seems like Espruino is reading the program as a 30-byte fragment of the full program, and crashing because the resulting syntax within the fragment is invalid.
We know for a fact that the program file itself is intact, as resetting the Bangle and starting the app again works fine (until a few minutes later when it starts throwing the exact same errors again).
For context, the program uses a relatively large amount of RAM, with only less than 300 blocks left out of the usable 2100 blocks, and that's when no function is running and everything is just waiting for events. I don't know exactly how much memory is used at maximum. We have already run into other problems caused by low free memory (which fortunately we have managed to work around) so I hope this is not yet another one of them.
May I ask what causes this, and how we could solve this problem? Thank you.