nuxt3
nuxt3 copied to clipboard
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);
Hey @PiotrekPKP! Are you using Nuxt3 rc2? I'm having the same issue and I'm trying to understand how to solve this
Thanks!
Seems like it's related to https://github.com/intlify/nuxt3/issues/64
Hey @PiotrekPKP! Are you using Nuxt3 rc2? I'm having the same issue and I'm trying to understand how to solve this
Thanks!
Yes, I'm using Nuxt 3 RC 2
EDIT: It's also broken on RC 3 which came out today
Seems like it's related to #64
More like #64 is related to this issue ;)
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"
}
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
Merged for v0.2.2
Merged for v0.2.2
invalid
@kazupon
Same issue. Do you have an idea? THX
npm install --save-dev @intlify/nuxt3
nuxt.config.ts export default defineNuxtConfig({ ssr: false, // Client-side only rendering (false) buildModules: ['@intlify/nuxt3'] })
error: Uncaught SyntaxError: The requested module '/_nuxt/.nuxt/intlify.vuei18n.options.mjs' does not provide an export named 'default'
"devDependencies": { "@intlify/nuxt3": "^0.2.2", "bulma": "^0.9.4", "nuxt": "3.0.0-rc.4", "sass": "^1.51.0" },
@androcado Try adding @intlify/nuxt3 to modules, not buildModules in the nuxt config.
@androcado Try adding @intlify/nuxt3 to modules, not buildModules in the nuxt config.
Thanks. But same issue:
export default defineNuxtConfig({ modules: ['@intlify/nuxt3'], })
error: vite_ssr_import_2.default is not a function
Odd, because I can't reproduce it
Odd, because I can't reproduce it
Thank you for your quick support:
npx nuxi init nuxt-app cd nuxt-app npm i npm install --save-dev @intlify/nuxt3
// nuxt.config.ts export default defineNuxtConfig({ modules: ['@intlify/nuxt3'], })
npm run dev // localhost: 3000 -> Uncaught SyntaxError: The requested module '/_nuxt/.nuxt/intlify.vuei18n.options.mjs' does not provide an export named 'default' (at plugin.mjs:3:8)
package.json { "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview" }, "devDependencies": { "@intlify/nuxt3": "^0.2.2", "nuxt": "3.0.0-rc.4" } }
npm -v // 6.14.11 node -v // v14.16.0 System: Windows 10
@androcado What does your package-lock.json look like?
I've recreated the application using your exact specification, albeit on MacOS
Would you mind sharing your package-lock please? I'll try to get a windows device to test the same config out
EDIT: Confirmed on Windows using Node v14.16.0 and NPM 6.14.11
I am getting the same error, is there any fix/solutuion ?
@kkurt @androcado do you guys have the same problem with a fresh project just using the @intlify/nuxt3
package?
I'm having multiple projects running on [email protected]
with @intlify/[email protected]
and not having any issues.
@kkurt @androcado do you guys have the same problem with a fresh project just using the
@intlify/nuxt3
package?I'm having multiple projects running on
[email protected]
with@intlify/[email protected]
and not having any issues.
is this on Mac or linux by chance?
@kkurt @androcado do you guys have the same problem with a fresh project just using the
@intlify/nuxt3
package? I'm having multiple projects running on[email protected]
with@intlify/[email protected]
and not having any issues.is this on Mac or linux by chance?
Yes i have still same issue. I realized that this is about OS. Because I have created fresh new project on stackblitz. There is no problem. But wehen i download same project to my local and run after "npm install", i recieved error. My OS is Win 11.
Stackblitz link : https://stackblitz.com/edit/nuxt-starter-va5flv
@kkurt What version of node and NPM are you running? My tests also failed when running on Windows.
MacOS and Linux work fine (for me)
@kkurt What version of node and NPM are you running? My tests also failed when running on Windows.
MacOS and Linux work fine (for me)
I also tried with yarn.
NodeJS : 16.15.1 Npm: 8.13.1 Yarn: 1.22.19
Thanks, with the last update it works for me.
pnpm run dev and see problem
https://github.com/intlify/nuxt3/issues/72#issuecomment-1184394295
For nuxt3 i18 from community