• 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 :/

About

Avatar for michalt @michalt started