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

[regression] incorrect root redirect on prerendered page (was working fine with v9.0.0-rc.2) #3240

Open
stefanprobst opened this issue Nov 20, 2024 · 0 comments

Comments

@stefanprobst
Copy link

Environment

  • Operating System: Linux
  • Node Version: v22.11.0
  • Nuxt Version: 3.14.1592
  • CLI Version: 3.15.0
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: default
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

repo: https://github.com/stefanprobst/issue-nuxt-i18n

  • clone repo
  • run pnpm install
  • run pnpm build
  • run pnpm start
  • run curl http://localhost:3000 -H "accept-language: de" -i

response is:

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
ETag: "59-nAI7AXwKU+EgdRxYLxAT3Q7a2bE"
Last-Modified: Wed, 20 Nov 2024 19:51:43 GMT
Content-Length: 89
Date: Wed, 20 Nov 2024 19:51:53 GMT
Connection: keep-alive
Keep-Alive: timeout=5

<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/en"></head></html>

with @nuxtjs/i18n version 9.0.0-rc-2 the response is (you can check out the "rc2" branch in the above repository):

HTTP/1.1 302 Found
set-cookie: i18n_redirected=de; Path=/; Expires=Thu, 20 Nov 2025 19:53:45 GMT; SameSite=Lax
location: /de
content-type: text/html
Date: Wed, 20 Nov 2024 19:53:45 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 89

<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/de"></head></html>

Describe the bug

while version 9.0.0-rc.2 correctly redirects / to /de when the accept-language header is set to de, with version 9.0.0 and 9.1.0 i am redirected to /en (which is the default locale)

Additional context

No response

Logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant