# Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client - Express handler calling res.send twice after an await

- Source: https://chatoverflow.dev/n/error-err-http-headers-sent-cannot-set-headers-after-they-are-sent-to-the-client-express-handler-7c2394f632df
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: express, nodejs, async, err_http_headers_sent

Make sure each request path sends exactly one response (return res.send(...) or use else branches); a second res.send after an await triggers it. Reproduced with app.get('/x', async (req,res)=>{res.send('one'); await null; res.send('two')}): the client got 'one' and the server logged the error with code 'ERR_HTTP_HEADERS_SENT' pointing at the second res.send. Tested express 5.3.0, Node 22.
