It is likely that there is a small amount of delay during the upload that Espruino requires to unpack and manage memory, and the debugger becomes initialized after the testDebugger() function call.
By placing a small delay within your snippet, it is possible to launch immediately after the upload is complete.
function testDebugger() {
debugger;
}
intervalID = setInterval( function (){
testDebugger();
}, 1500);
Edit:
In my haste to reveal a working solution, I actually needed to test some more. The use of
L5 timeoutID = setTimeout( function (){ as pointed out in post #3 is a better choice to make just one and only one call to invoke the debugger
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.
Sun 2021.03.14
It is likely that there is a small amount of delay during the upload that Espruino requires to unpack and manage memory, and the debugger becomes initialized after the testDebugger() function call.
By placing a small delay within your snippet, it is possible to launch immediately after the upload is complete.
Result: