pnpm dlx nuxi init nuxt-app
cd nuxt-app
pnpm i
pnpm build
Describe the bug
When building, some dependencies are failing
Additional context
and in old project i get
No response
No response
misaon, yezipi, lyykfi, fatrex, mktrue, cawa-93, jakubkosinski99, PieterHollevoet, phlqp, joshistoast, and 8 more reacted with thumbs up emoji
joshistoast reacted with eyes emoji
All reactions
As much as nothing broke on my side, I had to rollback to RC3 as with RC4 the last terminal log was Vite server warmed up in (...)
and then my machine resources' usage went up. Something is not right with Vite since last RC? The Vite server built in (...)
never appears.
My Nuxt project is large already and it would be difficult to find what breaks the dev build. I checked it with a fresh RC4 project and it runs fine though.
I’m getting a similar issue, but when I upgraded I had the build error:
ERROR Identifier 'createError' has already been declared (Note that you need plugins to import files that are not JavaScript)
.
Tested using Darwin and Ubuntu 20.04 and both have this error using the new RC 4, when reverting to RC 3 it works fine.
Nuxi CLI v3.0.0-rc.4
Nuxt project info:
------------------------------
- Operating System: `Darwin` & `Ubuntu`
- Node Version: `v16.15.1`
- Nuxt Version: `3.0.0-rc.4`
- Package Manager: `yarnpkg`
- Builder: `vite`
- User Config: `-`
- Runtime Modules: `-`
- Build Modules: `-`
------------------------------
As much as nothing broke on my side, I had to rollback to RC3 as with RC4 the last terminal log was Vite server warmed up in (...)
and then my machine resources' usage went up. Something is not right with Vite since last RC? The Vite server built in (...)
never appears.
My Nuxt project is large already and it would be difficult to find what breaks the dev build. I checked it with a fresh RC4 project and it runs fine though.
Had this experience as well. About a week ago my large Nuxt 3 rc3 app stopped building on Vercel, with the same symptoms of hanging on "Vite server warmed up in (...)" and never posting "Vite server built in (...)" until eventually Vercel just timed my build out (45min). My builds typically take 2min. I downgraded to rc2 (3.0.0-rc.2-27530889.9e5a3cd) and that fixed the issue for a while, until today when this "useCookie" error referenced in the original post started occurring (even on rc2). Upgrading to rc4 does not fix the issue. So maybe it's a downstream issue from a Nuxt dependency?
EDIT: Was able to mitigate this by downgrading to RC1 (3.0.0-rc.1-27510703.46ecbc5). Like I mentioned, downgrading to RC2 (which was working for me as of 3 days ago), or RC3, does not fix the issue for me.
More Identifier 'xxx' has already been declared
Identifier 'xxx' has already been declared
Jun 14, 2022
today I met the same error, What's more strange is that I have been using the RC1 version so far without any change, but this error occurred suddenly today.
aslo, it just appears in docker build, not on my windows computer
ERROR Rollup error: Identifier 'useRuntimeConfig' has already been declared (Note that you need plugins to import files that are not JavaScript)
#14161
I can't reproduce it in a clean init. Can anyone share a minimal reproduction repo with lock file? Thanks.
Hi! Same issue here! I can give you an access to my private repo (is not a big project) if you want
As the documentation states, we should use this command to install dependencies when we're using pnpm:
pnpm i --shamefully-hoist
Tried with simple pnpm i
:
amiria703@amiria703:/tmp/nuxt-app$ pnpm i
WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
Packages: +604
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /tmp/.pnpm-store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 616, reused 1, downloaded 595, added 604, done
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 1.6s
devDependencies:
+ nuxt 3.0.0-rc.4
amiria703@amiria703:/tmp/nuxt-app$ pnpm build
> @ build /tmp/nuxt-app
> nuxt build
Nuxt CLI v3.0.0-rc.4 01:15:49
ERROR Failed to resolve force included dependency: vue 01:16:09
ERROR Failed to resolve import "ufo" from "virtual:nuxt:/tmp/nuxt-app/.nuxt/paths.mjs". Does the file exist? 01:16:09
ERROR Failed to resolve import "vue" from "virtual:nuxt:/tmp/nuxt-app/.nuxt/components.plugin.mjs". Does the file exist? 01:16:09
ERROR [vite]: Rollup failed to resolve import "ufo" from "virtual:nuxt:/tmp/nuxt-app/.nuxt/paths.mjs". 01:16:09
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
ERROR [vite]: Rollup failed to resolve import "ufo" from "virtual:nuxt:/tmp/nuxt-app/.nuxt/paths.mjs". 01:16:09
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at onRollupWarning (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-8f5c9290.js:41772:19)
at onwarn (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-8f5c9290.js:41588:13)
at Object.onwarn (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:23224:13)
at ModuleLoader.handleResolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:22508:26)
at node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:22469:26
ELIFECYCLE Command failed with exit code 1.
But with pnpm i --shamefully-hoist
:
amiria703@amiria703:/tmp/nuxtest$ pnpm i --shamefully-hoist
WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
WARN GET https://registry.npmjs.org/@babel%2Fhelper-annotate-as-pure error (ECONNRESET). Will retry in 10 seconds. 2 retries left.
Packages: +604
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /tmp/.pnpm-store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 616, reused 596, downloaded 0, added 604, done
devDependencies:
+ nuxt 3.0.0-rc.4
amiria703@amiria703:/tmp/nuxtest$ pnpm build
> @ build /tmp/nuxtest
> nuxt build
Nuxt CLI v3.0.0-rc.4 01:35:05
ℹ Vite client warmed up in 10698ms 01:35:30
ℹ Client built in 10839ms 01:35:30
ℹ Building server... 01:35:30
✔ Server built in 3189ms 01:35:33
✔ Generated public .output/public nitro 01:35:33
start Building server... nitro 01:35:33
start Writing server bundle... nitro 01:35:50
✔ Server built nitro 01:35:57
├─ .output/server/package.json (307 B) (182 B gzip)
├─ .output/server/index.mjs (458 B) (254 B gzip)
├─ .output/server/chunks/nitro/node-server.mjs.map (57.4 kB) (4.4 kB gzip)
├─ .output/server/chunks/nitro/node-server.mjs (15.9 kB) (5.13 kB gzip)
├─ .output/server/chunks/handlers/renderer.mjs.map (1.92 MB) (91.4 kB gzip)
├─ .output/server/chunks/handlers/renderer.mjs (431 kB) (98.6 kB gzip)
├─ .output/server/chunks/app/server.mjs.map (163 kB) (23.5 kB gzip)
├─ .output/server/chunks/app/server.mjs (152 kB) (39.4 kB gzip)
├─ .output/server/chunks/app/client.manifest.mjs.map (336 B) (220 B gzip)
└─ .output/server/chunks/app/client.manifest.mjs (384 B) (230 B gzip)
Σ Total size: 3.28 MB (394 kB gzip)
✔ You can preview this build using node .output/server/index.mjs nitro 01:36:01
Hi guys, when I delete de "pages" folder I run "npm run build" with no issues, and if a create/put the "pages" folder back and run again "npm run build" the error occur. Even if "pages" is empty, the error shows up.
NO ERROR / NO PAGES FOLDER:
ERRROR / WITH PAGES FOLDER
As the documentation states, we should use this command to install dependencies when we're using pnpm:
pnpm i --shamefully-hoist
Tried with simple pnpm i
:
amiria703@amiria703:/tmp/nuxt-app$ pnpm i
WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
Packages: +604
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /tmp/.pnpm-store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 616, reused 1, downloaded 595, added 604, done
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 1.6s
devDependencies:
+ nuxt 3.0.0-rc.4
amiria703@amiria703:/tmp/nuxt-app$ pnpm build
> @ build /tmp/nuxt-app
> nuxt build
Nuxt CLI v3.0.0-rc.4 01:15:49
ERROR Failed to resolve force included dependency: vue 01:16:09
ERROR [vite]: Rollup failed to resolve import "ufo" from "virtual:nuxt:/tmp/nuxt-app/.nuxt/paths.mjs". 01:16:09
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
ERROR [vite]: Rollup failed to resolve import "ufo" from "virtual:nuxt:/tmp/nuxt-app/.nuxt/paths.mjs". 01:16:09
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at onRollupWarning (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-8f5c9290.js:41772:19)
at onwarn (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-8f5c9290.js:41588:13)
at Object.onwarn (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:23224:13)
at ModuleLoader.handleResolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:22508:26)
at node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:22469:26
ELIFECYCLE Command failed with exit code 1.
But with pnpm i --shamefully-hoist
:
amiria703@amiria703:/tmp/nuxtest$ pnpm i --shamefully-hoist
WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
WARN GET https://registry.npmjs.org/@babel%2Fhelper-annotate-as-pure error (ECONNRESET). Will retry in 10 seconds. 2 retries left.
Packages: +604
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /tmp/.pnpm-store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 616, reused 596, downloaded 0, added 604, done
devDependencies:
+ nuxt 3.0.0-rc.4
amiria703@amiria703:/tmp/nuxtest$ pnpm build
> @ build /tmp/nuxtest
> nuxt build
Nuxt CLI v3.0.0-rc.4 01:35:05
ℹ Vite client warmed up in 10698ms 01:35:30
ℹ Client built in 10839ms 01:35:30
ℹ Building server... 01:35:30
✔ Server built in 3189ms 01:35:33
✔ Generated public .output/public nitro 01:35:33
start Building server... nitro 01:35:33
start Writing server bundle... nitro 01:35:50
✔ Server built nitro 01:35:57
├─ .output/server/package.json (307 B) (182 B gzip)
├─ .output/server/index.mjs (458 B) (254 B gzip)
├─ .output/server/chunks/nitro/node-server.mjs.map (57.4 kB) (4.4 kB gzip)
├─ .output/server/chunks/nitro/node-server.mjs (15.9 kB) (5.13 kB gzip)
├─ .output/server/chunks/handlers/renderer.mjs.map (1.92 MB) (91.4 kB gzip)
├─ .output/server/chunks/handlers/renderer.mjs (431 kB) (98.6 kB gzip)
├─ .output/server/chunks/app/server.mjs.map (163 kB) (23.5 kB gzip)
├─ .output/server/chunks/app/server.mjs (152 kB) (39.4 kB gzip)
├─ .output/server/chunks/app/client.manifest.mjs.map (336 B) (220 B gzip)
└─ .output/server/chunks/app/client.manifest.mjs (384 B) (230 B gzip)
Σ Total size: 3.28 MB (394 kB gzip)
✔ You can preview this build using node .output/server/index.mjs nitro 01:36:01
Not everybody here uses pnpm, my project uses yarn and got the same issues.
@jamaluddinrumi I still can't reproduce it, either in stackblitz or in a fresh yarn install
locally. If you delete .nuxt
and node_modules
, then reinstall, does that make a difference?
ya, everything is fine with yarn dev
but not with yarn build
Here a simply example to reproduce this bug: stackblitz.com/edit/github-49tvxk-ugx2wx yarn build
Thanks! I can reproduce with this. Investigating now.
Thanks for the quick fix, seems like downgrading nitropack to 0.4.4 by adding it to resolutions fixes this for yarn – until it's officially updated.
"resolutions": {
"nitropack": "0.4.4"
Thanks for the quick fix, seems like downgrading nitropack to 0.4.4 by adding it to resolutions fixes this for yarn – until it's officially updated.
"resolutions": {
"nitropack": "0.4.4"
Seems like this way doesn't work for npm.
Thanks for the quick fix, seems like downgrading nitropack to 0.4.4 by adding it to resolutions fixes this for yarn – until it's officially updated.
"resolutions": {
"nitropack": "0.4.4"
Seems like this way doesn't work for npm.
For npm, use overrides
:
"overrides": {
"nitropack": "0.4.4"
danielroe, cawa-93, riderx, ueberflieger50, HomeGridMx, does1tmatter, itzaks, and arlenpeiffer reacted with hooray emoji
danielroe, misaon, antfu, loremru, mattmaribojoc, ueberflieger50, HomeGridMx, jamaluddinrumi, luveqz, does1tmatter, and 3 more reacted with heart emoji
All reactions
Thanks @danielroe that stop the issue in my reproduction repo, but not in the original repo, i don't find how to reproduce it to share it
My main repo is open-source, so it can be a way to reproduce too :
https://github.com/riderx/indiemakers/tree/netlify-edge
on netlify-edge
branch do pnpm i
and then NITRO_PRESET=netlify-edge npx pnpm build
ERROR [vite]: Rollup failed to resolve import "vue" from "node_modules/.pnpm/[email protected]/node_modules/nuxt/dist/app/entry.mjs". 16:13:43
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
I am getting a similar error Identifier '_unref' has already been declared (Note that you need plugins to import files that are not JavaScript)
when using Nuxt 3.0.0-rc.9 with Nitro 0.5.1
Setting an override to 0.4.4
or 0.4.8
doesn't fix this either.
This only happens on npm run generate whereas npm run build works fine.
ERROR Identifier '_unref' has already been declared (Note that you need plugins to import files that are not JavaScript) 09:49:32
file: /Users/rich/dev/www/xxxx/web/components/SliderA.vue:8:196
6: import { default as __nuxt_component_5 } from "/Users/rich/dev/www/xxxx/web/components/ProjectTerms.vue";
7: import { ref, computed, onMounted } from 'vue';
8: import { unref as _unref, resolveComponent as _resolveComponent, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, unref as _unref } from "vue"
9: import { ssrRenderComponent as _ssrRenderComponent, ssrRenderAttr as _ssrRenderAttr, ssrRenderAttrs as _ssrRenderAttrs, ssrRenderList as _ssrRenderList, ssrInterpolate as _ssrInterpolate } from "vue/server-renderer"
ERROR Identifier '_unref' has already been declared (Note that you need plugins to import files that are not JavaScript) 09:49:32
at error (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
at Module.error (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:12412:16)
at Module.tryParse (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:12789:25)
at Module.setSource (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:12694:24)
at ModuleLoader.addModuleSource (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22136:20)
I have this error
I am using nuxt 3.0.0-rc.11 and trying to add vue-number-animation plugin
there is no problem with yarn dev but when i try to generate it gives me this error how can i fix can someone help me?
I face this issue with github actions ci, and solved by using
pnpm i --shamefully-hoist && pnpm run build
insteadof