Rotary encoders for whatever reason seem to be problematic on the ESP32 and ESP8266. Maybe because "setWatch" uses polling instead of interrupts? I'm not sure. At least your setup is not crashing as it did for me.
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.
Rotary encoders for whatever reason seem to be problematic on the ESP32 and ESP8266. Maybe because "setWatch" uses polling instead of interrupts? I'm not sure. At least your setup is not crashing as it did for me.
http://forum.espruino.com/conversations/332965/#comment14722654
You could try different pins. This could at least improve the situation.