Have you updated your firmware at all? The 3 LEDs signifies an internal error, but as I recall that hasn't happened in firmwares for a year or more (it was usually to do with the secure bonding that HID devices often get asked to do)
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.
What you're doing sounds fine, but...
Have you updated your firmware at all? The 3 LEDs signifies an internal error, but as I recall that hasn't happened in firmwares for a year or more (it was usually to do with the secure bonding that HID devices often get asked to do)