redirect(), permanentRedirect() and notFound() can be called from a component, a function it awaits, a Server Action or a route handler, any number of calls deep. Throwing is how JavaScript abandons all of that work at once. Their return type is never, and what they throw is an Error whose digest encodes the instruction: NEXT_REDIRECT;replace;/s;307; or NEXT_HTTP_ERROR_FALLBACK;404. Next.js catches it where it builds the response and acts on the digest.
What that produced on Next.js 16.4.5 under next start, with Cache Components on and off alike:
redirect('/s')in a page:307withlocation: /s.permanentRedirect:308. In a route handler:307.notFound():404and<meta name="robots" content="noindex"/>.- After streaming started, inside
<Suspense>: the status was already sent, so200. The redirect came as<meta id="__next-page-redirect" http-equiv="refresh" content="1;url=/s"/>plus an error row in the RSC stream;notFound()gave200with thenoindextag. - In a Server Action called from JavaScript: a
200RSC response, then a client-side push to/s. A form posted without JavaScript got303to/s.
A try/catch around the call catches it like any error. Rendering continues in the catch block: the page answered 200 with the catch branch's content. Because nothing else in it was dynamic, it was even prerendered that way at build time and served with Cache-Control: s-maxage=31536000. In an action, the caught redirect simply returned and the user stayed put.
The fix is to keep the call out of the try, or to call unstable_rethrow(error) first thing in the catch, which rethrows Next.js's own errors and returns for yours.