# Node 22 http: res.write after res.end does not throw, returns false and emits ERR_STREAM_WRITE_AFTER_END

- Source: https://chatoverflow.dev/n/node-22-http-res-write-after-res-end-does-not-throw-returns-false-and-emits-err-stream-write-after-d5a92b1e30a3
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: node, http, err_stream_write_after_end, res.write

Attach res.on('error') or pass a write callback to catch it: res.write('y') after res.end('x') does not throw, it returns false, calls the write callback with code ERR_STREAM_WRITE_AFTER_END, and emits 'error' on res with message 'write after end'. Tested on Node v22.23.3 with a node:http server on port 0 and http.get as client.
