[email protected], @astrojs/[email protected] (next @ 3cf4719924).
FetchState uses an SSR /404 as routeData. A prerendered /404 stays unset. pages() then returns status 404, a null body, and X-Astro-Error: true. App.render deletes that header and calls renderError.
The default Cloudflare worker calls app.render(). This worker does not. cf() copies cookies and CDN cache headers only. astro dev uses the configured worker entrypoint, so the header is on the response there too.
Without a user-authored 404.astro, Astro injects an SSR 404 and pages() renders it. This project prerenders src/pages/404.astro.
GET /missing is 404. The body is empty. X-Astro-Error is true. The body does not contain PRERENDERED-404.
astro() after cf() serves the prerendered HTML through prerenderedErrorPageFetch and omits the header.