-
-
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 show with i18n and prefixDefaultLocale enabled #12750
Comments
@ematipico Sorry to bother you, but I have seen that you solved the original bug some weeks ago. Are you able to reproduce this bug? |
Please refrain from tagging me, especially since I haven't interacted with the issue. |
Closing, I can't reproduce the bug from the reproduction. It works as expected |
Thank you for taking the time to review this issue and for your feedback. I understand that you were unable to reproduce the problem, where visiting a non-existing path without a locale prefix (like /test) correctly shows the custom 404 page. However, the bug remains reproducible on my end using the StackBlitz example. To assist further, I’ve recorded a video that demonstrates the unexpected behavior: Screencast.From.2024-12-17.12-50-41.mp4In the video:
If there’s a misunderstanding on my part about the expected behavior, I’d greatly appreciate clarification. Otherwise, I’d be grateful if you could take another look when time permits. If additional details about my environment or reproduction setup would be helpful, please let me know—I’m happy to assist further. |
In your example, the |
Yes, I know that I should get a 404. However, instead of showing the 404 page defined in |
Sorry, using a path with a locale made things very confusing for me. |
My bad, I should have explained the issue more clearly. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
The bug is closely related to #12509, which was solved by #12525 when
prefixDefaultLocale
is set tofalse
. However, the bug is still present whenprefixDefaultLocale
is set totrue
.Test setup
Open a new project and create localized folders, with a folder for the default locale too (i.e.
prefixDefaultLocale
set totrue
), as specified by the i18n guide.Create a
404.astro
page in/pages
.Results
Visiting any URL prefixed with one of the supported languages shows the custom 404 page.
Visiting any URL without a valid language prefix shows a blank page.
Example
With
["es", "en", "fr"]
as supported locales anden
as the default locale:/en/blabla
=> 404 page/fr/blabla
=> 404 page/blabla
=> blank page/it/blabla
=> blank pageWhat's the expected result?
Any path that doesn't exist should show the custom 404 page.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-leyrunqm?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: