i18n: Building app using `strategy: 'prefix'` throws pre-render `(Error: [301])`
Environment
- Operating System:
Darwin - Node Version:
v16.16.0 - Nuxt Version:
3.6.5 - Nitro Version:
2.5.2 - Package Manager:
npm@8.11.0 - Builder:
vite - User Config:
- - Runtime Modules:
- - Build Modules:
-
Reproduction
https://stackblitz.com/edit/nuxt-starter-jkohmm?file=nuxt.config.ts
Describe the bug
When trying to use strategy: 'prefix', Im getting (Error: [301])
Additional context
No response
Logs
✔ Server built in 920ms 12:55:12 PM
✔ Generated public .output/public nitro 12:55:12 PM
ℹ Initializing prerenderer nitro 12:55:12 PM
ℹ Prerendering 2 routes nitro 12:55:13 PM
├─ /test (64ms) (Error: [301] ) nitro 12:55:13 PM
├─ / (65ms) (Error: [301] ) nitro 12:55:13 PM
nitro 12:55:13 PM
Errors prerendering:
├─ /test (301) nitro 12:55:13 PM
├─ / (301) nitro 12:55:13 PM
nitro 12:55:13 PM
ERROR Exiting due to prerender errors. 12:55:13 PM
at Module.prerender (node_modules/nitropack/dist/shared/nitro.1db3349c.mjs:204:11)
at async eval (node_modules/nuxt/dist/index.mjs:2658:7)
at async build (node_modules/nuxt/dist/index.mjs:3811:5)
at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:74:5)
at async _main (node_modules/nuxi/dist/cli.mjs:64:20)
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 19
You can specifically set your root to not prerender. This solved it for me:
disclaimer
i am not planning on running this
staticsonuxt generatewas a mistake in my case for this particular project.running
generateresults in an errorError: [404] Page not found: /And its fine to not have a root
index.htmlfile ?