Ok, got the error.
const connectWifi = () => new Promise((resolve, reject) => { wifi.connect(SSID, { password: PASS }, function(e) { if (e) { console.log("error during connect:", e); wifi.disconnect(); reject(e); } else { console.log("connected to", SSID); wifi.stopAP(); resolve(wifi); } }); });
has to be
const connectWifi = () => { return new Promise((resolve, reject) => { wifi.connect(SSID, { password: PASS }, function(e) { if (e) { console.log("error during connect:", e); wifi.disconnect(); reject(e); } else { console.log("connected to", SSID); wifi.stopAP(); resolve(wifi); } }); }); };
difficult to track, because both formats are valid, and text editor can't catch the issue :/
@michalt started
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.
Ok, got the error.
has to be
difficult to track, because both formats are valid, and text editor can't catch the issue :/