You are reading a single comment by @cmo and its replies. Click here to read the full conversation.
  • Thanks for the reply Gordon. Yes it's for an ESP32 (ESP-WROOM-32) with Espruino build 1v94. Here's the full example where I get an error.

    var http = require('http');
    
    var server=http.createServer(function(req, res){
        res.writeHead(200);
        res.end("Hello World");
        console.log("res sent");
    }).listen(80);
    
    setTimeout(function(){
        server.close();
    },5000);
    

    And the error message I get

    Uncaught Error: Field or method "close" does not already exist, and can't create it on undefined
     at line 1 col 7
    server.close();
          ^
    

    The webserver continues to work before and after the error. I tried this on an ESP8226 and get the same error also.

    Again, any help is very much appreciated.

About

Avatar for cmo @cmo started