Closed maestroosram closed 5 months ago
glob
is not used directly by @nuxt/image
. Would you provide a reproduction?
Would you be able to provide a reproduction? 🙏
Hi, here a reproduction: https://stackblitz.com/edit/github-jjft2q?file=package.json
If you run npm run build
you will see the error.
glob
is a direct dependancy of nuxt -> nuxt devtools - but the default 8.0.0 requires inflight
which is now unsupported, so forcing to the 9.0.0. creates the error in build.
It is not a direct dependency of @nuxt/devtools
though it is a dependency of @npmcli/package-json
which is a dependency of pacote
which is used in @nuxt/devtools
. (But it is not v8 which is the version depended upon, but v10.)
Investigating, it seems v8 is required by nitro, via its dependency on @rollup/plugin-commonjs
. I would suggest you raise the issue on @rollup/plugin-commonjs
instead 🙏
I overrided the default dependency of
glob
to^9.0.0
in order to get rid ofinflight
which has been marked as unsopported as it leaks memory.When doing so, if
nuxt-image
is loaded as a module the default node-server build fails with this error:[nitro] ERROR Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit: (node-externals) buildEnd
Simply commenting out'@nuxt/image'
from themodules
in the nuxt.config fixes the issue.If using a different nitro preset (like 'cloudflare-pages') the build succedes.
package.json
{ "name": "nss-nuxt", "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "devDependencies": { "@nuxt/image": "^1.7.0", "@nuxtjs/i18n": "^8.0.0", "@pinia-plugin-persistedstate/nuxt": "^1.2.0", "nuxt": "^3.11.2", "nuxt-delay-hydration": "^1.3.3", "nuxt-gtag": "^2.0.5", "sass": "^1.64.2" }, "overrides": { "vue": "latest", "glob": "^9.0.0" }, "dependencies": { "@gtm-support/vue-gtm": "^2.2.0", "@nuxtjs/device": "^3.1.1", "@pinia/nuxt": "^0.5.1", "@vuelidate/core": "^2.0.3", "@vuelidate/validators": "^2.0.3", "nuxt-jsonld": "^2.0.8", "nuxt-swiper": "^1.2.2", "pinia": "^2.1.6" } }