Are you using the 1v92 firmware? I know there was an issue where trying to send a HID packet before HID was initialised (eg the device had been disconnected and reconnected) would leave it in a state where it wouldn't work until after a reboot, but I'm pretty sure I fixed that in 1v92.
In 1v92 I think it's safest just to try...catch the error when you make the call though. It shouldn't do any harm.
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.
Are you using the 1v92 firmware? I know there was an issue where trying to send a HID packet before HID was initialised (eg the device had been disconnected and reconnected) would leave it in a state where it wouldn't work until after a reboot, but I'm pretty sure I fixed that in 1v92.
In 1v92 I think it's safest just to
try...catch
the error when you make the call though. It shouldn't do any harm.