i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Strategy prefix with detectBrowserLanguage not redirecting correctly on root in Static Site Generation

Open FabianRzepka opened this issue 1 year ago • 0 comments

Environment

Reproduction

https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-cs5xbf?file=nuxt.config.ts

On local work fine.

site.com/ --> click /nlto save cookie --> site.com/ redirect to site.com/nl

npm run generate npx serve .output/public

site.com/ --> click /nlto save cookie --> site.com/ redirect to default lang site.com/en

Describe the bug

After generating a static page with pnpm run generate and uploading it to hosting the application does not detect the existing cookie or browser language, in the case of (root) site.com it always redirects to defaultLocale (en) site.com/en. When running the site locally, pnpm run dev or run build works correctly.

in addition, the "prefix" mode adds an error in the console after entering the root path.

image

Additional context

related? old task #2507

No response

Logs

No response

FabianRzepka avatar Feb 15 '24 08:02 FabianRzepka