nuxt3: After adding `"@intlify/nuxt3"` to `buildModules` in `nuxt.config.ts` there's a Nuxt error

I installed "@intlify/nuxt3" and added it to my buildModules.

After adding "@intlify/nuxt3" to buildModules in nuxt.config.ts there’s a Nuxt error:

__vite_ssr_import_2__.default is not a function

The error occurs even after reinstallation of package and after removing .nuxt directory.

Stacktrace:

at ./.nuxt/dist/server/server.mjs:3590:60
at fn (./.nuxt/dist/server/server.mjs:396:27)
at Object.callAsync (./node_modules/unctx/dist/index.mjs:41:19)
at callWithNuxt (./.nuxt/dist/server/server.mjs:398:23)
at applyPlugin (./.nuxt/dist/server/server.mjs:353:29)
at Module.applyPlugins (./.nuxt/dist/server/server.mjs:363:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async createNuxtAppServer (./.nuxt/dist/server/server.mjs:46:7)
at async renderToString (./node_modules/vue-bundle-renderer/dist/index.mjs:252:19)
at async ./.nuxt/dev/index.mjs:486:20

The line that shows an error is this one:

const loadedOptions = await __vite_ssr_import_2__.default();

This line is in a code block:

const { vueApp: app } = nuxt;
  const loadedOptions = await __vite_ssr_import_2__.default();
  if (!isEmpty(__vite_ssr_import_3__.default)) {
    loadedOptions.messages = __vite_ssr_import_3__.default;
  }
  const i18n = __vite_ssr_import_0__.createI18n({
    legacy: false,
    globalInjection: true,
    locale: "en",
    ...loadedOptions
  });
  app.use(i18n);

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 29
  • Comments: 25 (8 by maintainers)

Most upvoted comments

Merged for v0.2.2

I’ve created a PR #65 as per @exreplay’s findings: https://github.com/intlify/nuxt3/issues/64#issuecomment-1127416063

The patch has been found to work with RC.3

As this issue is the last one that’s open.

Overriding the following packages in package.json will temporarily fix it by forcing rc-1 to be used

  "overrides": {
    "nuxi": "3.0.0-rc.1",
    "nuxt": "3.0.0-rc.1",
    "@nuxt/kit": "3.0.0-rc.1",
    "@nuxt/schema": "3.0.0-rc.1",
    "@nuxt/vite-builder": "3.0.0-rc.1"
  }