# Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client when trying to setup redirects + handle 404
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
3.xpending triageneeds reproduction
sendRedirect not redirecting in api route or server middleware
3.xpending triage
Cannot set headers after they are sent to the client
bugnitropossible regression
Cannot set headers after they are sent to the client
pending triage2.x