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

After upgrading to 3.8.1, nuxt dev breaks if you have a .env file with DEBUG=true #24154

Closed
cll0ud opened this issue Nov 6, 2023 · 2 comments · Fixed by #24162
Closed

After upgrading to 3.8.1, nuxt dev breaks if you have a .env file with DEBUG=true #24154

cll0ud opened this issue Nov 6, 2023 · 2 comments · Fixed by #24162

Comments

@cll0ud
Copy link

cll0ud commented Nov 6, 2023

Environment


  • Operating System: Linux
  • Node Version: v18.18.2
  • Nuxt Version: 3.8.1
  • CLI Version: 3.9.1
  • Nitro Version: 2.6.3
  • Package Manager: yarn@1.22.19
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Look at the console:
https://codesandbox.io/p/sandbox/gracious-paper-mylhf8

Describe the bug

If you have a .env file with DEBUG=true, the dev server will throw a bunch of errors related to finding node modules:

⚙ [nuxt] warmup for node:https failed with: Failed to load url node:https (resolved id: node:https). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 1)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmupViteServer (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:854:3)

Additional context

The problem doesn't seem to happen with <3.8.0 versions, I had just upgraded from 3.7.4 to 3.8.1 with npx nuxi upgrade. Tried with multiple node versions (~18.xx, ~20.xx) in WSL2.

The log attached was taken from the reproduction link (hence the warning about the Node version).

Logs

yarn run v1.22.19
$ nuxt dev

[6:13:31 PM]  WARN  Current version of Node.js (16.17.0) is unsupported and might cause issues.
       Please upgrade to a compatible version >= 18.0.0.

Nuxt 3.8.1 with Nitro 2.7.2                                         6:13:31 PM
                                                                    6:13:31 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

[nuxt] modules:before: 0.167ms                                      6:13:33 PM
[nuxt] kit:compatibility: 4.394ms                                   6:13:33 PM
[nuxt] kit:compatibility: 4.963ms                                   6:13:33 PM
[nuxt] kit:compatibility: 5.129ms                                   6:13:33 PM
[nuxt] kit:compatibility: 5.24ms                                    6:13:33 PM
[nuxt] kit:compatibility: 5.397ms                                   6:13:33 PM
[nuxt] kit:compatibility: 5.457ms                                   6:13:33 PM
[nuxt] kit:compatibility: 5.563ms                                   6:13:33 PM
[nuxt] kit:compatibility: 5.707ms                                   6:13:33 PM
[nuxt] kit:compatibility: 5.825ms                                   6:13:33 PM
[nuxt] kit:compatibility: 6.009ms                                   6:13:33 PM
[nuxt] devtools:before: 0.072ms                                     6:13:33 PM
[nuxt] devtools:initialized: 0.105ms                                6:13:34 PM
  ➜ DevTools: press Shift + Alt + D in the browser (v1.0.0)         6:13:34 PM

ℹ Module @nuxt/devtools took 1331.7ms to setup.                    6:13:34 PM
[nuxt] pages:extend: 0.177ms                                        6:13:34 PM
[nuxt] kit:compatibility: 0.032ms                                   6:13:34 PM
ℹ Module pages took 5.95ms to setup.                               6:13:34 PM
[nuxt] kit:compatibility: 1.344ms                                   6:13:34 PM
[nuxt] kit:compatibility: 1.56ms                                    6:13:34 PM
[nuxt] kit:compatibility: 1.901ms                                   6:13:34 PM
[nuxt] kit:compatibility: 1.937ms                                   6:13:34 PM
[nuxt] kit:compatibility: 2.229ms                                   6:13:34 PM
[nuxt] kit:compatibility: 2.522ms                                   6:13:34 PM
[nuxt] kit:compatibility: 2.876ms                                   6:13:34 PM
[nuxt] kit:compatibility: 3.281ms                                   6:13:34 PM
[nuxt] kit:compatibility: 3.506ms                                   6:13:34 PM
[nuxt] kit:compatibility: 3.815ms                                   6:13:34 PM
ℹ Module meta took 5.57ms to setup.                                6:13:34 PM
ℹ Module components took 1.2ms to setup.                           6:13:34 PM
[nuxt] imports:sources: 0.602ms                                     6:13:34 PM
[nuxt] imports:context: 0.042ms                                     6:13:34 PM
[nuxt] imports:dirs: 0.042ms                                        6:13:34 PM
[nuxt] imports:extend: 0.11ms                                       6:13:34 PM
ℹ Module imports took 10.89ms to setup.                            6:13:34 PM
ℹ Module nuxt-config-schema took 4.17ms to setup.                  6:13:34 PM
[nuxt] schema:extend: 0.055ms                                       6:13:34 PM
[nuxt] schema:resolved: 0.014ms                                     6:13:34 PM
[nuxt] modules:done: 15.495ms                                       6:13:34 PM
[nuxt] nitro:config: 0.116ms                                        6:13:34 PM

[6:13:34 PM]  WARN  Node fetch compatibility is enabled. Please consider upgrading to Node.js >= 18.

[nuxt] nitro:init: 0.519ms                                          6:13:34 PM
[nuxt] ready: 0.853ms                                               6:13:34 PM
[nuxt] listen: 0.017ms                                              6:13:34 PM
[nuxt] devtools:customTabs: 0.172ms                                 6:13:34 PM
[nuxt] components:dirs: 0.013ms                                     6:13:34 PM
[nuxt] app:resolve: 2.004ms                                         6:13:34 PM
[nuxt] pages:extend: 0.039ms                                        6:13:34 PM
[nuxt] prepare:types: 0.357ms                                       6:13:34 PM
[nuxt] components:extend: 1.089ms                                   6:13:34 PM
[nuxt] app:templates: 18.791ms                                      6:13:34 PM
ℹ Compiled app-component.mjs in 4.48ms                             6:13:34 PM
ℹ Compiled types/app.config.d.ts in 4.59ms                         6:13:34 PM
ℹ Compiled app.config.mjs in 4.83ms                                6:13:34 PM
ℹ Compiled nitro.client.mjs in 5.17ms                              6:13:34 PM
ℹ Compiled css.mjs in 5.18ms                                       6:13:34 PM
ℹ Compiled fetch.mjs in 5.47ms                                     6:13:34 PM
ℹ Compiled error-component.mjs in 5.77ms                           6:13:34 PM
ℹ Compiled layouts.mjs in 6.14ms                                   6:13:34 PM
ℹ Compiled middleware.mjs in 6.33ms                                6:13:34 PM
ℹ Compiled types/nitro-nuxt.d.ts in 6.26ms                         6:13:34 PM
ℹ Compiled nuxt.config.mjs in 6.61ms                               6:13:34 PM
ℹ Compiled types/plugins.d.ts in 6.66ms                            6:13:34 PM
ℹ Compiled paths.mjs in 6.37ms                                     6:13:34 PM
ℹ Compiled root-component.mjs in 6.57ms                            6:13:34 PM
ℹ Compiled test-component-wrapper.mjs in 6.18ms                    6:13:34 PM
ℹ Compiled types/vue-shim.d.ts in 6.44ms                           6:13:34 PM
ℹ Compiled vue-router-stub.d.ts in 6.51ms                          6:13:34 PM
ℹ Compiled pages.mjs in 6.8ms                                      6:13:34 PM
ℹ Compiled unhead-plugins.mjs in 7.05ms                            6:13:34 PM
ℹ Compiled components.d.ts in 7.28ms                               6:13:34 PM
ℹ Compiled components.plugin.mjs in 6.88ms                         6:13:34 PM
ℹ Compiled component-names.mjs in 7.74ms                           6:13:34 PM
ℹ Compiled components.islands.mjs in 7.96ms                        6:13:34 PM
ℹ Compiled devtools/settings.mjs in 12.11ms                        6:13:34 PM
ℹ Compiled imports.d.ts in 11.19ms                                 6:13:34 PM
ℹ Compiled imports.mjs in 12.13ms                                  6:13:34 PM
ℹ Compiled types/schema.d.ts in 14.54ms                            6:13:34 PM
ℹ Compiled types/imports.d.ts in 56.48ms                           6:13:34 PM
ℹ Compiled plugins/server.mjs in 109.39ms                          6:13:34 PM
ℹ Compiled plugins/client.mjs in 128.17ms                          6:13:34 PM
[nuxt] imports:extend: 0.129ms                                      6:13:35 PM
[nuxt] app:templatesGenerated: 3ms                                  6:13:35 PM
[nuxt] build:before: 0.016ms                                        6:13:35 PM
[nuxt] vite:extend: 0.731ms                                         6:13:35 PM
[nuxt] vite:extendConfig: 1.189ms                                   6:13:35 PM
[nuxt] vite:configResolved: 0.023ms                                 6:13:35 PM
[nuxt] builder:chokidar:watch: 715.152ms                            6:13:35 PM
[nuxt] vite:serverCreated: 1.716ms                                  6:13:35 PM
[nuxt] server:devHandler: 0.116ms                                   6:13:35 PM
[nuxt] vite:extendConfig: 0.565ms                                   6:13:35 PM
[nuxt] vite:configResolved: 0.016ms                                 6:13:35 PM
[nuxt] build:manifest: 0.129ms                                      6:13:35 PM
[nuxt] vite:serverCreated: 0.225ms                                  6:13:36 PM
[nuxt] schema:beforeWrite: 0.011ms                                  6:13:36 PM
ℹ Vite client warmed up in 1386ms                                  6:13:37 PM
[6:13:37 PM] ⚙ [nuxt] warmup for node:http failed with: Failed to load url node:http (resolved id: node:http). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmupViteServer (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:854:3)
[6:13:37 PM] ⚙ [nuxt] warmup for node:https failed with: Failed to load url node:https (resolved id: node:https). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 1)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmupViteServer (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:854:3)
[6:13:37 PM] ⚙ [nuxt] warmup for node:zlib failed with: Failed to load url node:zlib (resolved id: node:zlib). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 3)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:stream failed with: Failed to load url node:stream (resolved id: node:stream). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 4)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:buffer failed with: Failed to load url node:buffer (resolved id: node:buffer). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 5)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:util failed with: Failed to load url node:util (resolved id: node:util). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 6)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:url failed with: Failed to load url node:url (resolved id: node:url). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 7)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:net failed with: Failed to load url node:net (resolved id: node:net). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 8)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:fs failed with: Failed to load url node:fs (resolved id: node:fs). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 9)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[6:13:37 PM] ⚙ [nuxt] warmup for node:path failed with: Failed to load url node:path (resolved id: node:path). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 10)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[nuxt] schema:written: 0.021ms                                      6:13:37 PM
[nuxt] nitro:build:before: 0.054ms                                  6:13:37 PM
[6:13:38 PM] ⚙ [nuxt] warmup for node:crypto failed with: Failed to load url node:crypto (resolved id: node:crypto). Does the file exist?

  at loadAndTransform (node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55015:21)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:839:7)
  at async Promise.all (index 0)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 5)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 2)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
  at async Promise.all (index 3)
  at async warmup (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.20543d77.mjs:849:7)
[nitro] rollup:before: 614.505ms                                    6:13:38 PM
ℹ Vite server warmed up in 2203ms                                  6:13:38 PM
✔ Nitro built in 745 ms                                      nitro 6:13:39 PM
[nitro] compiled: 0.572ms                                           6:13:39 PM
[nuxt] build:done: 2.530s                                           6:13:39 PM
> Nitro Start (9ms)
[nitro] dev:reload: 378.208ms                                       6:13:39 PM
[nitro-runtime] request: 0.558ms
[nuxt-app] app:created: 0.972ms
[nuxt-app] vue:setup: 0.025ms
[nuxt-app] app:rendered: 0.013ms
[nitro-runtime] render:html: 0.033ms
[nitro-runtime] render:response: 0.016ms
[nitro-runtime] beforeResponse: 0.013ms
[nitro-runtime] afterResponse: 0.019ms
[nitro-runtime] request: 0.081ms
[nuxt-app] app:created: 0.47ms
[nuxt-app] vue:setup: 0.012ms
[nuxt-app] app:rendered: 0.016ms
[nitro-runtime] render:html: 0.014ms
[nitro-runtime] render:response: 0.008ms
[nitro-runtime] beforeResponse: 0.01ms
[nitro-runtime] afterResponse: 0.011ms
@dany68
Copy link

dany68 commented Nov 7, 2023

Hi,
I confirm, I got the same bug.

@danielroe
Copy link
Member

Thanks for spotting! This is a non-fatal issue but should be resolved in #24162.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants