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

nuxt dev fails because process undefined outside node_modules #22744

Closed
littledivy opened this issue Mar 6, 2024 · 2 comments
Closed

nuxt dev fails because process undefined outside node_modules #22744

littledivy opened this issue Mar 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@littledivy
Copy link
Member

Can be reproduced after applying #22743

$ ~/gh/littledivy/deno/target/debug/deno task dev
Task dev nuxt dev
Nuxt 3.10.3 with Nitro 2.9.1                                                      4:50:10 pm
                                                                                  4:50:10 pm
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

  ➜ DevTools: press Shift + Alt + D in the browser (v1.0.8)                       4:50:12 pm

✔ Nuxt Nitro server built in 808 ms                                        nitro 4:50:15 pm
error: Uncaught (in worker "$DENO_STD_NODE_WORKER_THREAD") (in promise) TypeError: Cannot read properties of undefined (reading 'env')
globalThis._importMeta_={url:import.meta.url,env:process.env};import { Server } from 'node:http';
                                                         ^
    at file:///home/divy/gh/littledivy/nuxt-app/.nuxt/dev/index.mjs:1:58
@littledivy littledivy added bug Something isn't working correctly node compat labels Mar 6, 2024
@littledivy
Copy link
Member Author

Blocked on nitrojs/nitro#2224

littledivy added a commit to littledivy/nitro that referenced this issue Mar 7, 2024
Fixes denoland/deno#22744
Ref denoland/deno#22744

This commit adds an emitted import to the process global of the Node.js adapter output.
This ensures the output can be used by Deno's Node compat layer.
@littledivy littledivy self-assigned this Mar 7, 2024
@littledivy
Copy link
Member Author

Fixed in Nuxt 3.11.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

1 participant