-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 page doesn't render in production mode #8054
Comments
@xriter Could not reproduce the issue. Works the same in dev and build on stackblitz. |
@lilnasy I made a little 🎞️ screen recording showing how to reproduce in Stackblitz. (Besides that I also experience this problem in real world projects of course). |
Is there a difference when you run |
@lilnasy I just tried. When running Although, I run a website in production in a Docker container, (that is using |
@lilnasy Not fully convinced about the workaround tag. See my updated previous comment. 🙈 |
If the 404 page was prerendered, it may have been an issue introduced recently. |
It uses the custom |
It should, unless the output config is "hybrid". |
The config is set as
From the docs (https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project) I understand that in that case you don't set |
Yeah, prerendering-related issues are probably not the culprit then. However, it might need another reproduction to investigate that issue. |
@lilnasy I do think the Important tag should be reapplied, since the assumed workaround doesn't actually work in the production environment (Docker). |
Could you share the dockerfile so I can try to confirm? |
Dockerfile
docker-compose.yml
|
Couldn't reproduce it with docker either. Temporary link to running project with |
Very interesting. I don't understand. I use those configurations. On a VPS, using reverse proxies; which keeps me looking in the area of something with dns resolving? It worked fine before. After 'some' update (don't know which version number) it just stopped. I get it to repro with |
Yes, I could reproduce the issue when running |
After having downgraded version by version, everything works fine up until 2.9.6. From 2.9.7 the problem starts occurring.
|
Unfortunately the updates of Astro 2.10.10 haven't solved this problem. |
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 nodev18.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
The text was updated successfully, but these errors were encountered: