Ahh, ok. I think your issue is you're not using the right module for the ESP8266 firmware - unfortuntely the two are different enough that a different module is needed. Try:
var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err) {
...
});
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.
Ahh, ok. I think your issue is you're not using the right module for the ESP8266 firmware - unfortuntely the two are different enough that a different module is needed. Try: