That's odd - are you sure you're just running that code above and not doing anything else, like scanning for advertisements or checking for light levels really really quickly?
I'm pretty sure the error happens in this case when the code running in the interrupt is trying to allocate memory, but it can't because Espruino is in the middle of garbage collecting - but generally Espruino garbage collects very rarely and doesn't take long. The only way I could force errors when testing was to run code every few milliseconds, while also connecting.
I don't think it should actually be that big a deal as it'll be trying to update the GattServer object, which you're not interested in - does it keep working regardless?
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.
That's odd - are you sure you're just running that code above and not doing anything else, like scanning for advertisements or checking for light levels really really quickly?
I'm pretty sure the error happens in this case when the code running in the interrupt is trying to allocate memory, but it can't because Espruino is in the middle of garbage collecting - but generally Espruino garbage collects very rarely and doesn't take long. The only way I could force errors when testing was to run code every few milliseconds, while also connecting.
I don't think it should actually be that big a deal as it'll be trying to update the GattServer object, which you're not interested in - does it keep working regardless?