Per-component translations are not available in ssr in the build mode
Environment
- Operating System: Linux
- Node Version: v23.10.0
- Nuxt Version: 3.16.1
- CLI Version: 3.23.1
- Nitro Version: 2.11.7
- Package Manager: [email protected]
- Builder: -
- User Config: compatibilityDate, devtools, modules, i18n
- Runtime Modules: @nuxtjs/[email protected]
- Build Modules: -
Reproduction
https://github.com/ryinner/nuxt-i18n-per-components-error
npm run build
node .output/server/index.mjs
Describe the bug
I have a child component Test that is called on the page. It contains a per-component translation and I expect these messages to be used during SSR, but I get a placeholder as if these messages are unavailable.
At the same time, everything is fine in dev mode.
Expected double TEST EN
BUT
This error is only in the components/, if I try to move them to the pages/, then everything will be fine.
Additional context
No response
Logs
Update: if i will remove lang="ts" i have two TEST EN
Same happening for me.
Current workaround is to either pass them as props from the page to the component or use global translations for components...
same for me