Skip to content

404 page doesn't render in production mode #8054

@xriter

Description

@xriter

What version of astro are you using?

2.10.7

Are you using an SSR adapter? If so, which one?

Node

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Safari

Describe the Bug

In SSR mode, when going to a page that doesn't exist, the 404 page should be rendered (the default or custom one). It does this correctly in dev mode, but in production mode it only renders a blank page.

Using @astrojs/node 5.3.3 with node v18.16.1

Also see the repro.
Run npm run build && npm run preview and go to /doesntexist.

What's the expected result?

The 404 page should be rendered correctly in SSR production mode.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-trfvka?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)feat: error pagesRelated to 404 and 500 handling (scope)pkg: nodeRelated to Node adapter (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions