\n\n\n### Additional context\n\nAt runtime the locales array is properly available see console log :\n\n\u003Cimg width=\"574\" height=\"98\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a567197b-ed0e-477c-a908-3ce9b0e47c7d\" />\n\n### Logs\n\n```shell\n\n```",[3172],{"name":3173,"color":3174},"pending triage","c2e0c6",3834,"nuxt-modules","i18n","open","TS error: According to typeScript locales property is not exported by usei18n composable","2025-10-04T07:35:11Z","https://github.com/nuxt-modules/i18n/issues/3834",0.7149438,{"description":3184,"labels":3185,"number":3198,"owner":3176,"repository":3177,"state":3178,"title":3199,"updated_at":3200,"url":3201,"score":3202},"### Environment\n\n•\tNuxt: 4.x\n•\t@nuxtjs/i18n: 10.x\n•\tNode.js: 20+\n•\tOS: macos\n•\tBrowser:chrome\n\n### Reproduction\n\n1.\tCreate a fresh Nuxt 4 project\n2.\tInstall @nuxtjs/i18n@^10\n3.\tMinimal nuxt.config.ts:\n```\nexport default defineNuxtConfig({\n i18n: {\n strategy: 'prefix',\n defaultLocale: 'en-US',\n locales: [\n { code: 'en-US', name: 'English' },\n { code: 'zh-CN', name: '简体中文' }\n ],\n detectBrowserLanguage: false,\n skipSettingLocaleOnNavigate: true,\n experimental: {\n preload: false,\n stripMessagesPayload: false\n }\n }\n})\n```\n4.\tRun npm run dev and open the homepage — you’ll see two logs for the same locale.\n\nCall stacks from first page load:\n\nCall 1 (App initialization)\n```\nloadMessagesFromClient (…/node_modules/@nuxtjs/i18n/dist/runtime/utils/load-messages.mjs:XX)\nloadAndSetLocale (…/node_modules/@nuxtjs/i18n/dist/runtime/utils/locale.mjs:XX)\nsetup (route-locale-detect.client.mjs:12)\napplyPlugins (…/node_modules/nuxt/dist/app/entry.mjs:XX)\ninitApp (…/node_modules/nuxt/dist/app/entry.mjs:XX)\n```\nCall 2 (Initial navigation / route normalization)\n```\nloadMessagesFromClient (…/node_modules/@nuxtjs/i18n/dist/runtime/utils/load-messages.mjs:XX)\nloadAndSetLocale (…/node_modules/@nuxtjs/i18n/dist/runtime/utils/locale.mjs:XX)\nsetup (route-locale-detect.client.mjs:13)\nrouter.replace / pushWithRedirect (…/node_modules/vue-router/dist/vue-router.mjs:XX)\n```\n\n### Describe the bug\n\nWhen using @nuxtjs/i18n v10 with Nuxt 4, loadMessagesFromClient is executed twice on the client during the first page load — once during app initialization and once again after the initial navigation normalization.\nEven with minimal config, browser language detection disabled, and skipSettingLocaleOnNavigate enabled, this still happens.\nFor runtime-loaded translations (e.g., from a remote API), the second internal load overwrites messages from the first, leading to inconsistent output.\n\n### Additional context\n\n•\tTried disabling detectBrowserLanguage and enabling skipSettingLocaleOnNavigate\n•\tNo custom route middlewares or manual setLocale calls\n•\tToggling experimental.preload had no effect\n•\tqueueMicrotask cannot guarantee correct overwrite order if local message files are large; only setTimeout(0) reliably delays after the second call, which is not ideal\n•\tLikely cause: route-locale-detect client plugin calls loadAndSetLocale both during app initialization and after initial navigation.\n•\tSuggestion: Provide an option to skip the second call in client mode, or internally cache per-locale loader results so repeated calls for the same locale return the same Promise instead of overwriting.\n\n### Logs\n\n```shell\n\n```",[3186,3189,3192,3195],{"name":3187,"color":3188},"bug 🐛","ee0701",{"name":3190,"color":3191},"performance","006b75",{"name":3193,"color":3194},"scope: dynamic resources","38FB12",{"name":3196,"color":3197},"scope: runtime","84b6eb",3773,"Messages fetched and merged twice on client initialization","2025-09-11T16:11:22Z","https://github.com/nuxt-modules/i18n/issues/3773",0.7263712,{"description":3204,"labels":3205,"number":3207,"owner":3176,"repository":3177,"state":3178,"title":3208,"updated_at":3209,"url":3210,"score":3211},"### Environment\n\n------------------------------\n- Operating System: Windows_NT\n- Node Version: v19.9.0\n- Nuxt Version: 3.17.3\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@9.6.3\n- Builder: -\n- User Config: modules, i18n, tailwindcss, css, plugins, devtools, compatibilityDate, runtimeConfig, vite, nitro\n- Runtime Modules: @geeks.solutions/nuxt-sections@3.0.1, @nuxt/image@1.10.0, @nuxtjs/i18n@9.5.4, @nuxtjs/tailwindcss@6.14.0, nuxt-lazytube@0.2.2, nuxt3-leaflet@1.0.13, @pinia/nuxt@0.11.0\n- Build Modules: -\n------------------------------\n\n\n### Reproduction\n\n* nuxt.config.ts\n\n```ts\nexport default defineNuxtConfig({\n ...(process.env.NODE_ENV === 'development' && {\n devServer: {\n https: {},\n host: '0.0.0.0',\n port: 443,\n }\n }),\n modules: [\n \"@geeks.solutions/nuxt-sections\",\n \"@nuxt/image\",\n \"@nuxtjs/i18n\",\n \"@nuxtjs/tailwindcss\",\n \"nuxt-lazytube\",\n \"nuxt3-leaflet\",\n \"@pinia/nuxt\"\n ],\n i18n: {\n detectBrowserLanguage: false,\n defaultLocale: \"en\",\n locales: [\n {\n name: \"French\",\n code: \"fr\",\n iso: \"fr\",\n file: \"fr.js\"\n },\n {\n name: \"English\",\n code: \"en\",\n iso: \"en\",\n file: \"en.js\"\n }\n ],\n langDir: \"lang/\",\n experimental: {\n localeDetector: 'localeDetector.ts'\n }\n },\n tailwindcss: {\n\n },\n css: [\n '~/assets/css/default.css'\n ],\n plugins: [\n '~/plugins/vue-dragscroll.js'\n ],\n devtools: { enabled: true },\n compatibilityDate: '2025-05-13',\n vite: {\n optimizeDeps: {\n include: ['quill', '@devdcodes9/quill-emojijs', 'quill-table-ui'],\n }\n },\n nitro: {\n compressPublicAssets: {\n gzip: true,\n brotli: true\n }\n }\n})\n```\n\n* localeDetector.ts inside i18n directory\n\n```ts\nconsole.log(\"Detector file loaded\")\n\n// Detect based on query, cookie, header\nexport default defineI18nLocaleDetector((event, config) => {\n\n console.log(\"Event\", event)\n\n // try to get locale from query\n const query = tryQueryLocale(event, { lang: '' }) // disable locale default value with `lang` option\n if (query) {\n return query.toString()\n }\n\n // try to get locale from cookie\n const cookie = tryCookieLocale(event, { lang: '', name: 'i18n_redirected' }) // disable locale default value with `lang` option\n if (cookie) {\n return cookie.toString()\n }\n\n // try to get locale from header (`accept-header`)\n const header = tryHeaderLocale(event, { lang: '' }) // disable locale default value with `lang` option\n if (header) {\n return header.toString()\n }\n\n // If the locale cannot be resolved up to this point, it is resolved with the value `defaultLocale` of the locale config passed to the function\n return config.defaultLocale\n})\n```\n\n* nuxi prepare\n* nuxi dev\n\n### Describe the bug\n\nI am trying to use the experimental localeDetector feature.\nThe localeDetector file is loaded and confirmed by having `Detector file loaded` logged on the server console.\n\nThe problem I am facing is that defineI18nLocaleDetector is never called and no Event is logged.\nAm I missing something ?\n\n### Additional context\n\nIn the documentation I saw that the local detector function is called per request on the server, so why the code inside the defineI18nLocaleDetector is never reached\n\n### Logs\n\n```shell\nNo errors logged at all\n```",[3206],{"name":3173,"color":3174},3651,"Code inside defineI18nLocaleDetector is not reached","2025-05-29T06:34:13Z","https://github.com/nuxt-modules/i18n/issues/3651",0.73458976,{"description":3213,"labels":3214,"number":3216,"owner":3176,"repository":3177,"state":3178,"title":3217,"updated_at":3218,"url":3219,"score":3220},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v22.18.0`\n- Nuxt Version: `4.1.2`\n- CLI Version: `3.28.0`\n- Nitro Version: `2.12.6`\n- Package Manager: `npm@10.9.3`\n- Builder: `-`\n- User Config: `compatibilityDate`, `devtools`, `modules`, `i18n`\n- Runtime Modules: `@nuxtjs/i18n@10.1.0`, `@nuxt/test-utils/module@3.19.2`\n- Build Modules: `-`\n\n\n### Reproduction\n\n- Install and setup I18n module\n- Add Nuxt testing\n- Use a component with translation (`const {.t } = useI18n();`) in the `setup` part of the component\n\nThe error case is set up in this repository, after cloning and installing dependencies the test run shows the error.\n\nhttps://github.com/gaborsoos-byborg/nuxt-i18n-testing\n\n### Describe the bug\n\nWhen testing a component in Vitest with NuxtTestUtils, translating a string with `$t` works fine, but translating with `const { t } = useI18n();` fails with the following error\n\n```\nstderr | ../test/components/Content.test.ts > Content > should render\n[Vue warn]: Unhandled error during execution of setup function \n at \u003CMountSuspendedComponent > \n at \u003CMountSuspendedHelper> \n at \u003CAnonymous ref=\"VTU_COMPONENT\" > \n at \u003CVTUROOT>\n \nSyntaxError: Need to install with `app.use` function\n ❯ createCompileError ../node_modules/@intlify/message-compiler/dist/message-compiler.mjs:77:19\n 75| ? format((messages || errorMessages)[code] || '', ...(args || []))\n 76| : code;\n 77| const error = new SyntaxError(String(msg));\n | ^\n 78| error.code = code;\n 79| if (loc) {\n ❯ createI18nError ../node_modules/vue-i18n/dist/vue-i18n.mjs:61:12\n ❯ useI18n ../node_modules/vue-i18n/dist/vue-i18n.mjs:2143:15\n ❯ setup components/Content.vue:2:15\n ❯ wrappedSetup ../node_modules/@nuxt/test-utils/dist/runtime-utils/index.mjs:99:28\n ❯ clonedComponent.setup ../node_modules/@nuxt/test-utils/dist/runtime-utils/index.mjs:190:48\n ❯ callWithErrorHandling ../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:200:19\n ❯ setupStatefulComponent ../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7936:25\n ❯ setupComponent ../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7897:36\n ❯ mountComponent ../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5227:7\n```\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[3215],{"name":3173,"color":3174},3827,"Test fails when using translation outside of template","2025-09-23T09:46:41Z","https://github.com/nuxt-modules/i18n/issues/3827",0.7380309,{"description":3222,"labels":3223,"number":3224,"owner":3176,"repository":3177,"state":3225,"title":3226,"updated_at":3227,"url":3228,"score":3229},"With [vue-i18n v10 soon entering its maintenance/hotfix-only status](https://vue-i18n.intlify.dev/guide/maintenance.html), and vue-i18n v12 entering alpha, we have some catching up to do.\n\nUpdating vue-i18n to its next major means breaking changes, albeit small ones in vue-i18n v11. We will take this as an opportunity to make some breaking changes in the form of cleanup and reorganization of config options.\n\nFeel free to suggest any changes and please let me know if some change needs reconsidering.\n\n- [x] Drop CJS, go ESM only\n- [x] Raise minimum Node version to v20\n- [x] Split up v9 (and earlier) documentation, see if we can move it to v9.i18n.nuxtjs.org\n- [ ] ~~Move `typescript` to `devDependencies` - this should cause no issues after updating `@intlify/unplugin-vue-i18n` but needs to be tested.~~ requires release, may not be possible since next release will be vue-i18n v12 compatible\n- [x] Update to Vue I18n v11 (see [breaking changes](https://vue-i18n.intlify.dev/guide/migration/breaking11.html))\n - [x] #3526 \n\u003C!-- - [ ] Stop support for path arguments for localized path resolution (e.g. `localePath('/')`, `localePath('/path?query=123')`) -->\n\u003C!-- - [ ] Warn if unsupported usage is detected - -->\n\u003C!-- - [ ] -->\n- [x] Remove migration ease for `restructureDir` - require a directory name (keep default value `'i18n'`)\n- [x] Drop `bundle.optimizeTranslationDirective` (#3238)\n- [x] Drop `experimental.generatedLocaleFilePathFormat` (we use hashed virtual files now)\n- [x] Strip `file`/`files` properties from `i18n.options.mjs` generated file\n- [x] Remove deprecated functionality\n - [x] Drop `$resolveRoute()`\n - [x] Drop `$localeLocation()`\n - [x] Drop `useLocaleLocation`\n- [x] Deprecate (remove in v11)\n - [x] `$localeHead` - reason: use-case unclear, `useLocaleHead` is more flexible and easier to maintain\n - [x] `$getRouteBaseName` - rename to `$routeBaseName` to be consistent with `useRouteBaseName` (still under consideration)\n- [x] Promoting experimental options\n - [x] `experimental.switchLocalePathLinkSSR` - enable by default\n - [x] `experimental.hmr` - move to `hmr`\n - [x] `experimental.autoImportTranslationFunctions` - enable by default, move out of experimental (where?)\n - [x] `experimental.alternateLinkCanonicalQueries` - enable by default, consider deprecating (dropping in v11)\n\n\u003C!-- - [ ] Consider replacing/migrating `defineI18nRoute` with/to `definePageMeta({ ... })` -->\n\u003C!-- - [ ] Move i18n routing options to `routing` key?\n - [ ] `trailingSlash` to `routing.trailingSlash` (consider dropping altogether)\n - [ ] `routesNameSeparator` to `routing.routesNameSeparator`\n - [ ] `defaultLocaleRouteNameSuffix` to `routing.defaultLocaleRouteNameSuffix` -->\n",[],3435,"closed","Roadmap to v10.0.0","2025-07-04T17:37:26Z","https://github.com/nuxt-modules/i18n/issues/3435",0.695721,{"description":3231,"labels":3232,"number":3236,"owner":3176,"repository":3177,"state":3225,"title":3237,"updated_at":3238,"url":3239,"score":3240},"### Environment\n\n- Operating System: Windows_NT\n- Node Version: v22.14.0\n- Nuxt Version: 3.16.2\n- CLI Version: 3.24.1\n- Nitro Version: 2.11.8\n- Package Manager: yarn@1.22.22\n- Builder: -\n- User Config: devtools, app, modules, css, build, i18n, site, compatibilityDate\n- Runtime Modules: @nuxtjs/tailwindcss@6.13.2, @nuxt/image@1.9.0, @nuxtjs/i18n@9.5.3, @hypernym/nuxt-anime@2.1.1, @nuxtjs/sitemap@7.2.10, @nuxtjs/robots@5.2.9 \n- Build Modules: -\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-yr15sl4p?file=locales%2Fen%2Findex.ts\n\n### Describe the bug\n\nI’m trying to auto-import all `.json` files in a ` locales/[lang]/` folder using `import.meta.glob` in each language’s `index.ts` file. This worked fine in Nuxt 2 using `require.context`, but in Nuxt 3 with` @nuxtjs/i18n`, I’m encountering the following error:\n\n`[plugin:vite:esbuild] Failed locale loading: 'unknown' type in **locales/ar/index.ts`**\n\n\n### Additional context\n\nWhat I’m Trying to Do\n```\n// locales/ar/index.ts\nconst modules = import.meta.glob('./**/*.json', { eager: true })\n\nconst messages: Record\u003Cstring, any> = {}\n\nfor (const path in modules) {\n const key = path\n .replace('./', '')\n .replace('.json', '')\n .replace(/\\//g, '.')\n messages[key] = modules[path].default\n}\n\nexport default messages\n```\n```\n// nuxt.config.ts\ni18n: {\n strategy: 'prefix_except_default',\n defaultLocale: 'ar',\n lazy: true,\n langDir: 'locales',\n locales: [\n { code: 'ar', name: 'Arabic', file: 'ar/index.ts' },\n { code: 'en', name: 'English', file: 'en/index.ts' }\n ]\n}\n```\n\nI expected Nuxt to allow ` import.meta.glob` usage in language-specific ` index.ts` files to auto-import and combine all locale messages from nested JSON files.\n\n**What Happened Instead**\n\nDynamic path template literals are not supported by Vite\n\nEven static `../locales/ar/**/*.json` fails due to path resolution issues\n\nErrors like `unknown type` or `Failed locale loading` appear\n\n\n**Workarounds Tried**\nUsing `require.context` – unsupported in Vite\n\nSwitching to manual static imports – works but violates DRY and doesn't scale\n\nMoving the glob loader to a utility file – still fails due to unresolved paths\n\nReplacing `lodash.set` with custom merging logic – no difference in behavior\n\nChecked paths, JSON validity, eager option – no effect\n\n### Logs\n\n```shell\n\n```",[3233],{"name":3234,"color":3235},"need more info","e295d6",3536,"Failed locale loading with static JSON imports in Nuxt 3","2025-05-23T10:27:57Z","https://github.com/nuxt-modules/i18n/issues/3536",0.70125467,{"description":3242,"labels":3243,"number":3247,"owner":3176,"repository":3177,"state":3225,"title":3248,"updated_at":3249,"url":3250,"score":3251},"### Environment\n\n```\n- Operating System: Darwin\n- Node Version: v22.14.0\n- Nuxt Version: 3.16.2\n- CLI Version: 3.25.0\n- Nitro Version: 2.11.9\n- Package Manager: npm@10.9.2\n- Builder: -\n- User Config: ssr, compatibilityDate, devtools, modules, i18n\n- Runtime Modules: @nuxt/content@3.4.0, @nuxtjs/i18n@9.5.3\n- Build Modules: -\n```\n\n### Reproduction\n\nReproduction: https://stackblitz.com/~/github.com/ismaoc/test2\nCode: https://github.com/ismaoc/test2\n\n### Describe the bug\n\nJust created a fresh Nuxt project with `npm create nuxt \u003Cproject_name>` and added nuxti18n with `npx nuxi@latest module add i18n`. Added a basic locale config (same as the docs) and get a \"not found error\" or \"Failed to parse JSON file.\" for the locales files.\n\nThe config\n\n```\ni18n: {\n lazy: false,\n locales: [\n { code: 'en', file: 'en' },\n { code: 'fr', file: 'fr' },\n ],\n }\n```\n\nthrows the error:\n\n\n```\n[9:12:36 PM] ERROR Pre-transform error: Failed to load url /i18n/locales/en (resolved id: /Users/user/pruebas/test2/i18n/locales/en) in /Users/user/pruebas/test2/.nuxt/i18n.options.mjs. Does the file exist?\n\n\n[9:12:36 PM] ERROR Pre-transform error: Failed to load url /i18n/locales/fr (resolved id: /Users/user/pruebas/test2/i18n/locales/fr) in /Users/user/pruebas/test2/.nuxt/i18n.options.mjs. Does the file exist?\n```\n\nIf I add the .json extension like this:\n\ni18n: {\n defaultLocale: 'en',\n locales: [\n { code: 'en', name: 'English', file: 'en.json' },\n { code: 'fr', name: 'Français', file: 'fr.json' }\n ]\n }\n\nthrows:\n\n```\n ERROR Pre-transform error: Failed to parse JSON file. 9:19:58 PM\n Plugin: vite:json\n File: /Users/user/pruebas/test2/i18n/locales/fr.json\n\n\n ERROR Pre-transform error: Failed to parse JSON file. 9:19:58 PM\n Plugin: vite:json\n File: /Users/user/pruebas/test2/i18n/locales/en.json\n```\n\nThanks.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[3244],{"name":3245,"color":3246},"upstream issue","fbca04",3560,"Bug: i18n Configuration Not Loading Locale Files","2025-05-16T11:33:25Z","https://github.com/nuxt-modules/i18n/issues/3560",0.71468383,{"description":3253,"labels":3254,"number":3256,"owner":3176,"repository":3177,"state":3225,"title":3257,"updated_at":3258,"url":3259,"score":3260},"### Environment\n\nOperating System: Linux\nNode Version: v22.11.0\n\"dependencies\": {\n \"@element-plus/icons-vue\": \"^2.3.1\",\n \"@nuxtjs/i18n\": \"^9.5.3\",\n \"@pinia/nuxt\": \"^0.10.1\",\n \"nuxt\": \"^3.16.2\",\n \"pinia\": \"^3.0.1\",\n \"vue\": \"^3.5.13\",\n \"vue-router\": \"^4.5.0\"\n },\n \"devDependencies\": {\n \"@antfu/eslint-config\": \"^4.11.0\",\n \"@element-plus/nuxt\": \"^1.1.1\",\n \"element-plus\": \"^2.9.7\",\n \"eslint\": \"^9.24.0\",\n \"sass\": \"^1.86.3\",\n \"sass-embedded\": \"^1.86.3\",\n \"typescript\": \"^5.8.3\"\n }\n\n### Reproduction\n\n低版本没有这个问题,打印值,服务端一次,客户端一次\n\n\n此次版本:\n\"nuxt\": \"^3.16.2\",\n\"@nuxtjs/i18n\": \"^9.5.3\",\n\n\n目录结构:根目录下 i18n -> locales -> locale.ts\nnuxt.config.ts文件\n\nmodules: [\n '@element-plus/nuxt',\n '@nuxtjs/i18n',\n ],\n i18n: {\n /* 较新版本的 @nuxtjs/i18n 模块中出现警告, 特别是与nuxt3.16.x一起使用 \n * bundle.optimizeTranslationDirective is enabled by default, we recommend disabling this feature as it causes issues and will be deprecated in v10.\n * bundle.optimizeTranslationDirective 功能在未来的 v10 版本中将被弃用,并且开发团队建议禁用它,因为它可能导致问题。\n * 明确设置此选项后,警告会消失,并且应用程序将更好地适应未来的 i18n 模块更新。\n * 如添加之后,警告未消失 1. 比对版本是否兼容 2. 缓存问题,nuxt使用了旧的缓存配置 npx nuxi cleanup\n */\n bundle: {\n optimizeTranslationDirective: false // 明确禁用此功能\n },\n // Module Options\n strategy: 'no_prefix', // 不为路由添加区域前缀\n defaultLocale: 'en', // 默认语种\n detectBrowserLanguage: false, // 禁用浏览器语言检测功能\n lazy: true,\n locales: [\n {\n code: 'en',\n file: 'locale.ts',\n },\n ],\n compilation: {\n strictMessage: false, // 允许message中包含html\n },\n },\n\n### Describe the bug\n\nexport default defineI18nLocale(async (locale) => {\n console.log(locale)\n})\n打印出来,打印了4次,服务端2次,客户端2次\n \n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[3255],{"name":3193,"color":3194},3538,"defineI18nLocale Repeated call problem, Server twice, client twice","2025-06-29T18:38:45Z","https://github.com/nuxt-modules/i18n/issues/3538",0.721394,{"description":3262,"labels":3263,"number":3267,"owner":3176,"repository":3177,"state":3225,"title":3268,"updated_at":3269,"url":3270,"score":3271},"I'm using nuxt4+ionic with i18n. the plugin i18n won't initialize. the i18n call the function usehead() from the head.js of ionic, before the initialisation of the app. this is the copy of the console\nruntime-core.esm-bundler.js:51 [Vue warn]: inject() can only be used inside setup() or functional components.\nwarn$1 @ runtime-core.esm-bundler.js:51\ninject @ runtime-core.esm-bundler.js:4075\nuseRoute @ vue-router.mjs:3783\nuseHead @ head.js:11\ncreateComposableContext @ utils.js:54\ncreateNuxtI18nContext @ context.js:114\nsetup @ i18n.js:40\nawait in setup\n(anonymous) @ nuxt.js:138\nfn @ nuxt.js:220\nrunWithContext @ runtime-core.esm-bundler.js:4038\ncallWithNuxt @ nuxt.js:226\n(anonymous) @ nuxt.js:37\nrun @ reactivity.esm-bundler.js:81\nrunWithContext @ nuxt.js:37\napplyPlugin @ nuxt.js:138\nexecutePlugin @ nuxt.js:157\napplyPlugins @ nuxt.js:193\nawait in applyPlugins\ninitApp @ entry.js:58\n(anonymous) @ entry.js:73\nnuxt.js:123 [nuxt] error caught during app initialization TypeError: Cannot read properties of undefined (reading 'path')\n at useHead (head.js:11:33)\n at createComposableContext (utils.js:54:11)\n at createNuxtI18nContext (context.js:114:23)\n at setup (i18n.js:40:17)\n at async applyPlugin (nuxt.js:138:25)\n at async executePlugin (nuxt.js:179:9)\n at async applyPlugins (nuxt.js:193:5)\n at async initApp (entry.js:58:7)\n(anonymous) @ nuxt.js:123\n(anonymous) @ index.mjs:48\n(anonymous) @ index.mjs:48\napp:error\nserialTaskCaller @ index.mjs:46\ncallHookWith @ index.mjs:198\ncallHook @ index.mjs:187\nhandleVueError @ entry.js:43\ninitApp @ entry.js:60\nawait in initApp\n(anonymous) @ entry.js:73\nruntime-core.esm-bundler.js:7073 \u003CSuspense> is an experimental feature and its API will likely change.\n",[3264],{"name":3265,"color":3266},"need reproduction","CD234A",3800,"i18n call usehead function outside the setup function","2025-09-12T15:16:21Z","https://github.com/nuxt-modules/i18n/issues/3800",0.7217208,{"description":3273,"labels":3274,"number":3279,"owner":3176,"repository":3177,"state":3225,"title":3280,"updated_at":3281,"url":3282,"score":3283},"### Environment\n\n- Operating System: Darwin\n- Node Version: v24.5.0\n- Nuxt Version: 4.0.3\n- CLI Version: 3.28.0\n- Nitro Version: 2.12.4\n- Package Manager: bun@1.2.20\n- Builder: -\n- User Config: modules, devtools, app, hooks, components, compatibilityDate, i18n, vite\n- Runtime Modules: @nuxt/eslint@1.8.0, @nuxt/test-utils/module@3.19.2\n- Build Modules: -\n\n(I am using a nuxt layer which configures the i18n module so I suspect that's the reason the module does not show up above)\n\n### Reproduction\n\nUnfortunately did not manage to create a reliable reproduction 😕\n\n### Describe the bug\n\nHello 👋,\n\nsince updating to the new version v10.0.4 I am having a problem with the i18n module. It seems the global `$t` instance is not available as I get the following error message: `ReferenceError: $t is not defined`.\n\nUnfortunately I wasn't able to create a minimal reproduction in stackblitz, so it must be something specific to my project that is causing this. Do you maybe have an idea what might be the issue or what I could check, based on the changes you did in v10.0.4?\n\nI am using the `$t` instance directly in my script setup block in a component and in there the error is thrown:\n```vue\n\u003Cscript setup lang=\"ts\">\n const test = computed(()=> $t('test'))\n\u003C/script>\n\n\u003Ctemplate>\n \u003Cspan>{{ test }}\u003C/span>\n\u003C/template>\n```\n\nIs this an anti-pattern and the `useI18n` composable should be used instead? I was using the global `$t` instance directly since it saved a line of code and worked up to v10.0.3.\n\nI can't share the full project as it is work-related but here are some additional informations about my setup:\n- Nuxt layers: the i18n module is set-up in a \"core\" layer and all other layers and the main app extend from it\n- Multiple translation files: one i18n folder per layer with layer-specific translations\n- I am not using any `i18n.config.ts` files\n\nSorry for the non-existant repro and minimal info but maybe you have an idea what I could try. Thanks. 🙏\n\n### Additional context\n\n### package.json\n```\n{\n \"name\": \"a-project\",\n \"private\": true,\n \"type\": \"module\",\n \"engines\": {\n \"node\": \"22.x\"\n },\n \"scripts\": {\n \"build\": \"nuxt build\",\n \"dev\": \"nuxt dev\",\n \"dev:host\": \"nuxt dev --host\",\n \"start\": \"node .output/server/index.mjs\",\n \"generate\": \"nuxt generate\",\n \"preview\": \"nuxt preview\",\n \"postinstall\": \"nuxt prepare\",\n \"test\": \"vitest run\",\n \"test:coverage\": \"vitest run --coverage\",\n \"lint\": \"eslint .\",\n \"lint:fix\": \"eslint . --fix\",\n \"prettier\": \"prettier --write .\",\n \"typecheck\": \"nuxt typecheck\"\n },\n \"dependencies\": {\n \"@iconify-json/lucide\": \"^1.2.62\",\n \"@nuxt/image\": \"^1.11.0\",\n \"@nuxt/ui\": \"^3.3.0\",\n \"@nuxtjs/i18n\": \"10.0.4\",\n \"@samk-dev/nuxt-vcalendar\": \"^1.0.4\",\n \"@tanstack/vue-query\": \"^5.83.1\",\n \"@vueuse/core\": \"^13.6.0\",\n \"dayjs\": \"^1.11.13\",\n \"dayjs-nuxt\": \"^2.1.11\",\n \"nuxt\": \"^4.0.3\",\n \"nuxt-auth-sanctum\": \"^1.1.2\",\n \"nuxt-charts\": \"^0.2.3\",\n \"nuxt-viewport\": \"^2.3.1\",\n \"v-calendar\": \"^3.1.2\",\n \"vue\": \"^3.5.18\",\n \"vue-router\": \"^4.5.1\",\n \"zod\": \"^4.0.17\"\n },\n \"devDependencies\": {\n \"@nuxt/eslint\": \"^1.8.0\",\n \"@nuxt/test-utils\": \"^3.19.2\",\n \"@tanstack/eslint-plugin-query\": \"^5.83.1\",\n \"@types/node\": \"^24.2.1\",\n \"@vue/test-utils\": \"^2.4.6\",\n \"eslint\": \"^9.33.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"happy-dom\": \"^18.0.1\",\n \"prettier\": \"^3.6.2\",\n \"prettier-plugin-organize-imports\": \"^4.2.0\",\n \"prettier-plugin-tailwindcss\": \"^0.6.14\",\n \"typescript\": \"^5.9.2\",\n \"vitest\": \"^3.2.4\",\n \"vue-tsc\": \"^3.0.5\"\n },\n \"patchedDependencies\": {\n \"@samk-dev/nuxt-vcalendar@1.0.4\": \"patches/@samk-dev%2Fnuxt-vcalendar@1.0.4.patch\"\n }\n}\n```\n\n### nuxt.config.ts\n```ts\nexport default defineNuxtConfig({\n // ...,\n i18n: {\n locales: [\n { code: 'de', file: 'de.app.json' },\n { code: 'en', file: 'en.app.json' },\n ],\n defaultLocale: 'de',\n strategy: 'no_prefix',\n experimental: {\n typedOptionsAndMessages: 'default',\n },\n },\n})\n```\n\n### Logs\n\n```shell\n\n```",[3275,3276],{"name":3265,"color":3266},{"name":3277,"color":3278},"possible regression","B78041",3775,"\"$t is not defined\" after updating to v10.0.4","2025-08-12T14:18:23Z","https://github.com/nuxt-modules/i18n/issues/3775",0.7243485,["Reactive",3285],{},["Set"],["ShallowReactive",3288],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fy8Cn7atkiJybn5G4o_69Ke19wf8lNYMHGDo-0_dYEX8":-1},"/nuxt-modules/i18n/3688"]