Loading...
Loading...
Browse 3 real-world technical and behavioral interview questions about Express. Review scenarios, edge cases, and architectural best practices.
ERR_HTTP_HEADERS_SENT means an Express route tried to set status or headers after the response had already been sent. The usual cause is two response paths: missing return after res.send, async callbacks racing, or an error handler trying to respond after headers are committed.
An Express error handler is skipped when it is not registered after routes, lacks the four-argument signature, or an async error never reaches next(). Express 4 needs explicit next(err) for rejected promises; Express 5 forwards them automatically.
Middleware runs in registration order, so ordering is behaviour rather than style: the request id precedes logging, the body parser precedes anything reading the body, authentication precedes authorisation, and the error handler goes last because Express only searches forward from the failure.