So you're using the Puck.js library on a website? And you're not using anything like Bluetooth MIDI or HID like the original poster was?
Do you have a stripped back example of the webpage you could post up that exhibits the problem?
It might be worth trying to react to the device not responding (rather than the close event) - so when that happens you could then attempt to trigger a close and a reconnect and see if that is any better.
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.
So you're using the Puck.js library on a website? And you're not using anything like Bluetooth MIDI or HID like the original poster was?
Do you have a stripped back example of the webpage you could post up that exhibits the problem?
It might be worth trying to react to the device not responding (rather than the close event) - so when that happens you could then attempt to trigger a close and a reconnect and see if that is any better.