Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with wrangler + nuxt + consola mocks #391

Open
demhat opened this issue Jan 17, 2025 · 3 comments
Open

issue with wrangler + nuxt + consola mocks #391

demhat opened this issue Jan 17, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@demhat
Copy link

demhat commented Jan 17, 2025

Environment

  • Consola: 3.2.3
  • Nodejs: 18.5.0
  • Package manager: Bun 1.1.44

Reproduction

16:05:08.060 [info] [nitro] Building Nuxt Nitro server (preset: cloudflare-pages, compatibility date: 2024-12-19)
16:05:09.567 [error] [nitro] Error: Could not load /opt/buildhome/repo/node_modules/unenv/runtime/npm/consola.mjs (imported by node_modules/@nuxt/icon/dist/runtime/server/api.js): ENOENT: no such file or directory, open '/opt/buildhome/repo/node_modules/unenv/runtime/npm/consola.mjs'
16:05:09.567  
16:05:09.568  
16:05:09.568 undefined
16:05:09.568 [error] Could not load /opt/buildhome/repo/node_modules/unenv/runtime/npm/consola.mjs (imported by node_modules/@nuxt/icon/dist/runtime/server/api.js): ENOENT: no such file or directory, open '/opt/buildhome/repo/node_modules/unenv/runtime/npm/consola.mjs'
16:05:09.568  
16:05:09.568  
16:05:09.568 [error] Could not load /opt/buildhome/repo/node_modules/unenv/runtime/npm/consola.mjs (imported by node_modules/@nuxt/icon/dist/runtime/server/api.js): ENOENT: no such file or directory, open '/opt/buildhome/repo/node_modules/unenv/runtime/npm/consola.mjs'
16:05:09.635 error: script "build" exited with code 1
16:05:09.642 node:events:652
16:05:09.642 return this.listener.apply(this.target, arguments);
16:05:09.642 ^
16:05:09.642  
16:05:09.642 q [Error]: Error while executing user command. Exited with error code: 1
16:05:09.643 at ChildProcess. (/snapshot/dist/run-build.js)
16:05:09.643 at Object.onceWrapper (node:events:652:26)
16:05:09.643 at ChildProcess.emit (node:events:537:28)
16:05:09.643 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
16:05:09.643  
16:05:09.643 Node.js v18.5.0
16:05:09.653 Failed: build command exited with code: 1
16:05:10.949 Failed: error occurred while running build command

Describe the bug

I'm getting this error that says Enoent no such file or folder node_modules/unenv/runtime/npm/consola.mjs when building on Cloudflare pages.

Additional context

No response

Logs

@demhat demhat added the bug Something isn't working label Jan 17, 2025
@pi0
Copy link
Member

pi0 commented Jan 17, 2025

can you please provide a reproduction? (it is likely a dep issue with wrangler)

@demhat
Copy link
Author

demhat commented Jan 18, 2025

You can find the minimal reproduction at https://github.com/Shaoula/otopilot

Only Nuxt UI 3 and Nuxthub are in modules. When both are active the error is:

Could not load /Users/demhat/Developer/Projects/otopilot/node_modules/unenv/runtime/npm/consola.mjs (imported by node_modules/@nuxt/icon/dist/runtime/server/api.js): ENOENT: no such file or directory, open '/Users/demhat/Developer/Projects/otopilot/node_modules/unenv/runtime/npm/consola.mjs'

When only Nuxthub is active, the error is:

Could not load /Users/demhat/Developer/Projects/otopilot/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/demhat/Developer/Projects/otopilot/node_modules/unenv/runtime/npm/mime.mjs'

Everything works well in the dev server but does not let build.

UPDATE: When I changed the pm from BUN to PNPM problem was solved. Bun pm causes the problem.

@pi0
Copy link
Member

pi0 commented Jan 19, 2025

I appreciate reproduction. I noticed wrangler is a dependency that pulls in the wrong version of unenv.

For now I'm moving it to unenv repo, unlikely we can do much for this issue now..

@pi0 pi0 transferred this issue from unjs/consola Jan 19, 2025
@pi0 pi0 changed the title Cannot find the module when building the code issue with wrangler + nuxt + consola mocks Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants