Skip to content
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 Response -> 404 page doesn’t work in dev server #7179

Closed
1 task
arty-name opened this issue May 23, 2023 · 4 comments
Closed
1 task

404 Response -> 404 page doesn’t work in dev server #7179

arty-name opened this issue May 23, 2023 · 4 comments
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@arty-name
Copy link
Contributor

What version of astro are you using?

2.5.4

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

no

What package manager are you using?

yarn

What operating system are you using?

Linux

What browser are you using?

Firefox

Describe the Bug

The newly added feature Render 404 page content for existing pages with 404 Response does not seem to work in dev mode, and only works in the built application.

You can see in the Stackblitz that the index page renders nothing when astro dev is running. If you stop it and run astro build && astro preview, only then the 404 page will be rendered for the index page returning status 404.

Link to Minimal Reproducible Example

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

Participation

  • I am willing to submit a pull request for this issue.
@paulrudy
Copy link
Contributor

paulrudy commented May 23, 2023

Just to add: Extra weirdness: after deploying (in my case to Vercel), navigating to a non-existent page /foo downloads a file named foo (Safari on Mac), rather than rendering a 404 page.

@predaytor
Copy link

experienced this too

@bholmesdev bholmesdev added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Jun 12, 2023
@natemoo-re
Copy link
Member

This was fixed in #7693 and should be released soon.

@jdbruxelles
Copy link

jdbruxelles commented Aug 10, 2023

I use astro v2.10.4 and Netlify and my 404 page is served as a plain text in dev when I use ntl dev which runs astro dev. But, when I run ntl dev --live, my 404 page is rendered correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

No branches or pull requests

6 participants