Internal server error: Failed to resolve import "../i18n/locales/en-US.json" from ".nuxt/i18n.options.mjs" on following lazy-load translation guide #3213
Internal server error: Failed to resolve import "../i18n/locales/en-US.json" from ".nuxt/i18n.options.mjs". Does the file exist?
Plugin: vite:import-analysis
File: /home/path/to/project/.nuxt/i18n.options.mjs:11:66
Describe the bug
From what I can see, i18n expects the translation files to be under i18n/locales directory, so moving the files from i18n to i18n/locales fixes the issue.
So just updating the example directory structure is enough. If confirmed, I'm happy to PR the fix in docs 😅 .
Environment
Linux
v22.11.0
3.13.2
3.15.0
2.9.7
npm@10.9.0
-
default
@nuxtjs/tailwindcss@6.12.2
,@nuxtjs/i18n@9.0.0-rc.2
-
Reproduction
npm run dev
, you will get error:Describe the bug
From what I can see,
i18n
expects the translation files to be underi18n/locales
directory, so moving the files fromi18n
toi18n/locales
fixes the issue.So just updating the example directory structure is enough. If confirmed, I'm happy to PR the fix in docs 😅 .
Additional context
No response
Logs