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

Custom 404 in SSR with trailingSlash = always not working #9079

Closed
1 task
msxdan opened this issue Nov 13, 2023 · 4 comments · Fixed by #9126
Closed
1 task

Custom 404 in SSR with trailingSlash = always not working #9079

msxdan opened this issue Nov 13, 2023 · 4 comments · Fixed by #9126
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: error pages Related to 404 and 500 handling (scope) feat: ssr Related to SSR (scope)

Comments

@msxdan
Copy link
Contributor

msxdan commented Nov 13, 2023

Astro Info

Astro                    v3.5.3
Node                     v18.16.0
System                   Windows (x64)
Package Manager          pnpm
Output                   hybrid
Adapter                  @astrojs/node
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Custom 404 file not being served when trailingSlash = always using node adapter

If the value of trailingSlash is either ignore or never it works fine, contents of custom 404.astro are served for any path or file not found

What's the expected result?

Expected result would be the 404.html content being served regardless the trailingSlash value

NOTE: run the reproduction using npm i && astro build && node dist/server/entry.mjs

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-qag26k?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Nov 13, 2023
@itsmatteomanf
Copy link
Contributor

I presume this might be the same as #9041 (comment).

@lilnasy lilnasy added - P4: important Violate documented behavior or significantly impacts performance (priority) feat: ssr Related to SSR (scope) feat: error pages Related to 404 and 500 handling (scope) and removed needs triage Issue needs to be triaged labels Nov 13, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Nov 13, 2023

Doesn't seem like it. The bug exists in 3.5.0 as well (before 9041's fix).

@itsmatteomanf
Copy link
Contributor

I know, it was two bugs, might not have been the fix of #9041 that caused this one as I previously assumed, but it's the same actual problem.

@lilnasy
Copy link
Contributor

lilnasy commented Nov 17, 2023

Fixed in the PR linked above. But heads up, because of the way prerendered 404 works, it still wont work in stackblitz with hybrid mode but it is fixed as well.
This is the preview version: astro@experimental--404-trailing-slash.

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) feat: error pages Related to 404 and 500 handling (scope) feat: ssr Related to SSR (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants