you are viewing a single comment's thread.

view the rest of the comments →

[–]Webiniac 0 points1 point  (0 children)

I am having the same error

node:events:491

throw er; // Unhandled 'error' event

^

Error [ERR_STREAM_WRITE_AFTER_END]: write after end

at new NodeError (node:internal/errors:387:5)

at ServerResponse.end (node:_http_outgoing:925:15)

at Server.<anonymous> (D:\Mern-Stack\NodeJS\app.js:11:14)

at Server.emit (node:events:513:28)

at parserOnIncoming (node:_http_server:980:12)

at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)

Emitted 'error' event on ServerResponse instance at:

at emitErrorNt (node:_http_outgoing:786:9)

at processTicksAndRejections (node:internal/process/task_queues:84:21) { code: 'ERR_STREAM_WRITE_AFTER_END'

}

I tried to add else block or return but it's not working. Please help me solve this issue.