And what exact messages do you get on the console? The messages you posted previously started like this:
req start
Closed: undefined
But you don't have those print statements in the code you posted up.
As it happens after Closed: undefined, it might be worth adding more print statements so you can get a better idea when the error is actually happening
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.
And what exact messages do you get on the console? The messages you posted previously started like this:
But you don't have those print statements in the code you posted up.
As it happens after
Closed: undefined
, it might be worth adding more print statements so you can get a better idea when the error is actually happening