Skip to content

localePath / NuxtLinkLocale hydration mismatches after browserRedirection with http web server #3828

@invoxiagau

Description

@invoxiagau

Environment

- Operating System: Darwin
- Node Version:     v22.18.0
- Nuxt Version:     4.1.2
- CLI Version:      3.28.0
- Nitro Version:    2.12.6
- Package Manager:  npm@10.9.3
- Builder:          -
- User Config:      compatibilityDate, devtools, modules, ssr, i18n
- Runtime Modules:  @nuxtjs/i18n@10.1.0
- Build Modules:    -

Reproduction

https://github.com/invoxiagau/nuxt-18-detectBrowserLanguage

  • Run the production cloud-build and cloud-run scripts (check README), the bug is only occurring when serving static files
  • Set your browser default language as french

Describe the bug

  • Visit localhost:8080
  • I18n correctly detects the browser default language and redirects to /fr
  • You can see a list of links using different methods to localise links such as NuxtLinkLocale, NuxtLink+ localePath
  • The content is getting translated in french
  • But, the links are not getting updated:

I expect: /fr/generic-page
Instead I get: /generic-page

I get the following error in my console:
Hydration completed but contains mismatches.

Additional context

I'm unable to reproduce this issue with the dev server, only after building and serving the static files using a http web server, in my case nginx.

Logs

Hydration completed but contains mismatches.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions