Closed kogratte closed 1 week ago
Got the same issue here
Coincidence or not, but when I updated Nuxt to 3.12.4, everything built without errors.
same here
I had the same problem. After deleting .nuxt and node_modules and reinstalling node_modules, it was gone
Hey. I am experiencing this issue. When developing a module, if I add this module to the playground, the playground will not start.
Here is a minimal reproduction link: https://stackblitz.com/edit/nuxt-starter-xqmvk1?file=playground/nuxt.config.ts
If you remove the comment in front of this module in the nuxt.config
file within the playground folder, you will get this error. I get this error when adding the content module to playground as well.
Is there any workaround for this at the moment?
Also got into this error just by using npx nuxi@latest init -t ui
followed by npm run dev
Locking the nitropack
version to 2.9.6
(from 2.9.7
) fixed the error for me.
I did this using the override
-section in package.json
:
"overrides": {
"nitropack": "2.9.6"
}
Similar issues haven been seen at other modules:
@Anton-Plagemann thank you for the patch. I tried it in the reproduction i posted above your comment and it worked! I added the override to the playground's package.json file. Appreciate it Next is to try it locally and then try deploying to Netlify
@pi0 Seems like the release of nitro 2.9.7 did break something, especially for clean setups (e.g. npx nuxi@latest init -t ui
or npx nuxi@latest init docs -t content
) or module authors (see my comment). It would be highly appreciated if you could take a look at this! 🙏
@Anton-Plagemann for local dev, i had to lock nitropack at v2.9.5 for things to work
@Anton-Plagemann I've got it working with nitro 2.9.7
hi folks, same issue, I think this is related:
Hi folks, something that fixed here is stop using pnpm. If I run pnpm install and later on I run the server I got this error, if I just run npm install and then npm run dev it runs smootly. But it needs to run in a new repo in which pnpm was never used.
I try to install nuxt/icon in this project rather than only install in the reusable layer, and then it works.
Same issue - I haven't managed to fix...
Here too.
Here too.
adding:
"overrides": {
"nitropack": "2.9.6"
}
to package.json solves the issue at this moment.
I tried
"overrides": {
"nitropack": "2.9.6"
}
and also directly npm install nitropack@2.9.6
but neither worked...
Steps to reproduce:
cd client
npm install
npm run build
: should be successfulnode .output/server/index.mjs
Which gives this:
node .output/server/index.mjs
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
TypeError [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier "#internal/nitro/virtual/app-config" is not defined in package /Users/jhumanj/Documents/coding/laravel-projects/notiontools/client/.output/server/node_modules/nitropack/package.json imported from /Users/jhumanj/Documents/coding/laravel-projects/notiontools/client/.output/server/node_modules/nitropack/dist/runtime/config.mjs
at new NodeError (node:internal/errors:405:5)
at importNotDefined (node:internal/modules/esm/resolve:353:10)
at packageImportsResolve (node:internal/modules/esm/resolve:803:9)
at moduleResolve (node:internal/modules/esm/resolve:967:16)
at defaultResolve (node:internal/modules/esm/resolve:1193:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:403:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:372:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:249:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:39)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_PACKAGE_IMPORT_NOT_DEFINED'
}
Node.js v18.19.0
What I tried:
I'm not sure if this is related, but at some point while trying to update all dependencies, i obtained the following error running the built server:
node .output/server/index.mjs
Listening on http://[::]:3000
[nuxt] [request error] [unhandled] [500] Cannot find module '/Users/jhumanj/Documents/coding/laravel-projects/OpnForm/client/.output/server/node_modules/vue/server-renderer/index.mjs' imported from /Users/jhumanj/Documents/coding/laravel-projects/OpnForm/client/.output/server/chunks/routes/renderer.mjs
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:327:11)
at moduleResolve (node:internal/modules/esm/resolve:980:10)
at defaultResolve (node:internal/modules/esm/resolve:1193:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:403:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:372:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:249:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:39)
at link (node:internal/modules/esm/module_job:75:36)
No real fix for this as yet? The overrides trick isnt working anymore
I tried to investigate but haven't had a clue yet. My assumption is that it might be caused by some transitive dependencies updates and introduced breakage that neither Nitro nor Nuxt Icon. But nothing confirmed yet.
Thanks @antfu . Have you experienced the problem locally? I can create meaningful docs for even a brand new module. The playground won't start if either the content module/icon module is in it.
If you can make a more minimal reproduction i would be happy to investigate it. It is most likely a module tries to import from #internal/nitro
(or worst #internal/nitro/*
) but they should instead import from nitropack/runtime
or better #imports
.
Hey @pi0 , I do have a minimal repo setup here: https://stackblitz.com/edit/nuxt-starter-xqmvk1?file=playground/nuxt.config.ts
Hey @pi0, also facing this when updating the deps of the demo project of the Supabase module.
If it helps, it can be reproduced on https://github.com/nuxt-modules/supabase/pull/409, just go in the demo
folder and run it.
Thanks for the reproductions.
Thanks for the fix. Now to make a report in the content module 🤣
Environment
npx nuxi info Working directory: /Users/nico/sources/empty-app 11:10:13 AM Nuxt project info: (copied to clipboard) 11:10:13 AM
Build Modules: -
Reproduction
I started from an empty app, then add a single nuxt module.
This module has been spotted in another context as being the source of the exact same issue. The link below is a reproduction context, with both dev and production run logs. It also provides the .output I got after using
npx nuxi build
.https://github.com/kogratte/nuxt-icons-issue
Describe the bug
Working on another project, I have an issue
Package import specifier "#internal/nitro/virtual/app-config" is not defined in package /Users/nico/sources/empty-app/node_modules/nitropack/package.json imported from /Users/nico/sources/empty-app/node_modules/nitropack/dist/runtime/config.mjs
.As we were not aware of the origin, we tried to deep dive to finaly use a "remove and try" method. We finally spotted that the simple presence of this module (nuxt/icons) in our reusable layer what at the origin of the issue. As soon as we remove it, things goes well.
We've been wondering if it could be due to a bad combination, and created the linked repository.
npx nuxi dev
=> Ends with error.npx nuxi build
=> OK.node .output/server/index.mj
=> Same error asnuxi dev
.Additional context
No response
Logs