Deployment fails with "Could not load /Users/user/Nuxt/app/node_modules/unenv/runtime/npm/mime.mjs" error
Describe the bug
On a fresh nuxt project with nuxthub module installed, I'm getting this error when deploying;
[nitro 8:49:15 AM] ERROR Error: Could not load /Users/user/Nuxt/app/node_modules/unenv/runtime/npm/mime.mjs (imported by node_modules/@nuxthub/core/dist/runtime/blob/server/utils/blob.js): ENOENT: no such file or directory, open '/Users/user/Nuxt/app/node_modules/unenv/runtime/npm/mime.mjs'
The file /Users/user/Nuxt/imagene/node_modules/unenv/runtime/npm/mime.mjs is missing.
It appears that the unenv package was upgraded from version 1.10.0 to 2.0.0-rc.0 when I ran npx nuxthub deploy, resulting in changes to the package structure.
Or am I missing something here? Thanks.
Steps to reproduce
- Install nuxthub module on a fresh install nuxt, run;
npx nuxthub deploy
- Deployment will fail with the error above
Nuxt info
- Operating System:
Darwin - Node Version:
v20.16.0 - Nuxt Version:
3.15.2 - CLI Version:
3.20.0 - Nitro Version:
2.10.4 - Package Manager:
[email protected] - Builder:
- - User Config:
compatibilityDate,devtools,modules - Runtime Modules:
@nuxthub/[email protected] - Build Modules:
-
Do you have a sharable reproduction? 🙏🏼
Do you have a sharable reproduction? 🙏🏼
I have a Stackblitz link, but I can't login to the NuxtHub, might not be helpful I think. 😅
Btw, after some debugging, here is what i found;
I'm using bun currently, seems like bun add --dev wrangler upgrades the unenv package from 1.10.0 to 2.0.0-rc.0, causing the deploy error
Then, using npm, I deploy a fresh nuxt project with nuxthub module and wrangler installed, the error is gone.
So this might be an issue with bun maybe?
I had the same error and was able to temporarily fix it by overriding the unenv version in package.json:
"resolutions": {
"unenv": "1.10.0"
}
Are you still experiencing this issue on a fresh project?