Answer the question
In order to leave comments, you need to log in
Why does Cannot read property 'Symbol(asyncId)' of null occur?
node.js version is 8.2.1. I don't think it was the best choice.
Why does an error occur Cannot read property 'Symbol(asyncId)' of null
?
_http_outgoing.js:636
nextTick(msg.socket[async_id_symbol],
^
TypeError: Cannot read property 'Symbol(asyncId)' of null
at write_ (_http_outgoing.js:636:24)
at ServerResponse.write (_http_outgoing.js:630:10)
at Timeout.setTimeout [as _onTimeout] (C:\Users\iamevg_\Desktop\app\app.js:8:9)
at ontimeout (timers.js:488:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:283:5)
let server = require("http").createServer().listen(8080);
server.on("request", (req, res) => {
res.writeHead(200);
res.write("Start");
setTimeout(() => {
res.write("Finish");
}, 3000);
req.on("data", msg => {
console.log(msg.toString());
});
req.on("end", () => {
res.end();
});
});
curl -d "Hello" http://localhost:8080
. The data comes in, but after the setTimeout expires, an error occurs. I just started learning node.js, so I can't even guess what the problem is. For a teacher, this code works fine, probably because it uses an earlier version. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question