And - just realized that I missed something. You want the power on BAT_IN, not VBAT. With battery on VBAT, it isn't protected from the USB trying to charge the batteries (you're always protected from the batteries trying to power USB)
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.
And - just realized that I missed something. You want the power on BAT_IN, not VBAT. With battery on VBAT, it isn't protected from the USB trying to charge the batteries (you're always protected from the batteries trying to power USB)