I tried installing the new version of Nuxt.js with command:
npx nuxi init nuxt-app
Then tried just run and project in Nuxt 3 works fine. But when I tried run this command:
npm run generate
Get this error message:
ERROR [nuxt] [request error] Package import specifier "#internal/nitro" is not defined in package C:\Users\Andreas\Projects\nuxt3-app\package.json imported from C:\Users\Andreas\Projects\nuxt3-app.nuxt\dist\server\server.mjs at new NodeError (node:internal/errors:371:5) at throwImportNotDefined (node:internal/modules/esm/resolve:442:9) at packageImportsResolve (node:internal/modules/esm/resolve:819:3) at moduleResolve (node:internal/modules/esm/resolve:973:21) at defaultResolve (node:internal/modules/esm/resolve:1080:11) at ESMLoader.resolve (node:internal/modules/esm/loader:530:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18) at ModuleWrap. (node:internal/modules/esm/module_job:79:40) at link (node:internal/modules/esm/module_job:78:36)
My package.json source code:
{
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview"
},
"devDependencies": {
"nuxt": "3.0.0-rc.1"
}
}
(Irrelevant solution, as this issue was in an RC version. Only leaving this solution for archive purposes. If you are using Nuxt and encounter this error, chances likely that this is not the correct solution. Please find another one)
-- Original comment --
I randomly fixed this issue by setting
// nuxt.config.ts
ssr: false
Hope its the case for you too.
With client side rendering only there is no server-side rendering. Client side rendering means rendering the content in the browser using JavaScript. Instead of getting all of the content from the HTML we just get a basic HTML document with a JavaScript file that will then render the rest of the site using the browser. For client side rendering set ssr to false.
Link to configuration-ssr documentation
Link to rendering-modes documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With