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

Astro Server Island returns 404 with i18n prefixDefaultLocale: true #12871

Closed
1 task
dallyh opened this issue Jan 1, 2025 · 2 comments
Closed
1 task

Astro Server Island returns 404 with i18n prefixDefaultLocale: true #12871

dallyh opened this issue Jan 1, 2025 · 2 comments
Labels
needs triage Issue needs to be triaged

Comments

@dallyh
Copy link

dallyh commented Jan 1, 2025

Astro Info

Astro                    v5.1.1
Node                     v22.12.0
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  @astrojs/node
Integrations             none

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

No response

Describe the Bug

When there is a deferred server island in an Astro page, then the island's endpoint returns status of 404, but it also returns the rendered HTML.

image

image

Setting prefixDefaultLocale to false fixes this issue, the island returns 200.

The reproducible example is set up to have a i18n routing middleware and manual routing, however it is also reproducible without it, that is having the configuration in the config file.

i18n: {
        locales: ["cs", "en"],
        defaultLocale: "cs",
        routing: {
            prefixDefaultLocale: true,
            redirectToDefaultLocale: false
        }
    },

In the example just navigate to either /en or /cs and check the terminal or browser network activity for an 404.

Edit:
Forgot to say that this is reproducible in the dev server and also after build.

What's the expected result?

Reponse code of 200 with the specified config.

Link to Minimal Reproducible Example

https://github.com/dallyh/astro-server-island-404

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 Jan 1, 2025
@sasoria
Copy link
Contributor

sasoria commented Jan 2, 2025

Thank you for the issue, this looks similar to #12817.

@ematipico
Copy link
Member

Duplicate of #12817

@ematipico ematipico marked this as a duplicate of #12817 Jan 2, 2025
@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants