nuxt-i18n-micro: Wrong locales path during SSR
Describe the bug I am facing a Vercel related bug, when transaltion keys are not resolved during SSR, It’s a bit complex project, so unfortunately I was not able to make a minimal reproduction, we use over 14 layers
But I am trying to figure out why locales can’t be resolved and it seem, it tries to load locales from a wrong path as you can see from Vercel logs here (we have disablePageLocales set to true
It tries to get data from /_locales/index/en/data.json where there are no data, it returns just empty json.
When I check the build output on the vercel I can see only general locales, so I also don’t know how it can resolves the previous path with empty json.
when I access url with /_locales/general/en/data.json the value is there.
in the bundle there is also top level folder called locales without underscore, where is the same output, could you explain a bit how are translations resolved both on server and client? 🙏
Could you give me a clue what I could try to change to get understanding what happens under the hood? Locally it works fine.
Thank you so much.
Screenshots
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 31 (16 by maintainers)
Yes, of course, I’d be happy to review and accept your PR!
I should also warn that the entire Nuxt 3.14.* version is buggy and slow, it’s better to use 3.13.* for now.
https://github.com/nuxt/nuxt/issues/30290 https://github.com/nuxt/nuxt/issues/30008
On serverless platforms,
$fetchwon’t be able to fetch static files as they are stored on the CDN and not internally to the nitro server. You might be able to setserveStaticto work around this temporarily but instead this module should probably implement a way to get this data on the server side using Nitro storage.