Custom 404 page injected using injectRoute
not used
#6937
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
injectRoute
not used
#6937
What version of
astro
are you using?2.3.2
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm/pnpm
What operating system are you using?
macOS / Stackblitz
What browser are you using?
Firefox
Describe the Bug
When a project includes
src/pages/404.astro
, this route gets used as a custom 404 page, including in dev.However, if an integration uses the
injectRoute
hook to inject a custom page at/404
, Astro does not treat this the same way: the injected page is only available at/404
, other 404 errors continue to show the standard Astro 404 screen during dev. (The injected route does get correctly built as404.html
though, so should work in production on static hosts that support that pattern like Netlify.)I’d expect injecting a route to
/404
to allow an integration to set the 404 users see during dev.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-3u16qb?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: