cli: Nuxt 3.7.0 slow initialization in DEV mode

Environment


  • Operating System: Windows_NT
  • Node Version: v18.14.0
  • Nuxt Version: 3.7.0
  • CLI Version: 3.7.3
  • Nitro Version: 2.6.2
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/AloisSeckar/demos-nuxt/tree/main/nuxt-simple

Describe the bug

After updating package.json dependency to "nuxt" : "3.7.0" my projects immedately start suffering from extremly long loading times when dev server is restarting or after refreshing the page in browser.

I linked my simple Nuxt starter, where it is happening as well. But so far I experienced the very same behavior in every project (4 different on 2 machines).

This is how my localhost:3000 gets rendered with 3.6.5: image

And this is the very same simple site after I just change Nuxt verson to 3.7.0: image

No errors or messages in the console nor the terminal (I am using VS Code for development). It just takes much, much longer to render the page.

I have noticed https://github.com/nuxt/cli/issues/109 but trying to run npm run dev --host 127.0.0.1 (or any other suggested --host option) I ended up with only NuxtWelcome component rendered instead of my actual application. Also announced fix in CLI 3.7.3 doesn’t seem to fix things for me 😦

Additional context

No response

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 13
  • Comments: 19 (3 by maintainers)

Most upvoted comments

I think I’ve seen a similar issue and the workaround until this is fixed is using 127.0.0.1:3000 instead of localhost:3000. Maybe that works for you

I think I’ve seen a similar issue and the workaround until this is fixed is using 127.0.0.1:3000 instead of localhost:3000. Maybe that works for you

I have also encountered the issue, and this workaround worked for me. Thank you for suggesting this. It was painful to wait every time. 😄

@pi0 Works splendid on localhost:300 via npx nuxi-edge@latest dev. Thanks to https://github.com/nuxt/cli/pull/184 there is now only port 3000. However, two notes:

  • 127.0.0.1:3000 stopped working altogether - I do not mind, but it’s somewhat unrelated change
  • VSC forwards one more port, seemingly randomized on execution; it is forwarded on 127.0.0.1 not localhost

On the other port (both 127.0.0.1:39561 and localhost:39561) I see my app running, /_nuxt works too on both. Not sure if this is intended.

We tried the edge channel today, suggested by daniel, but the issue persists.

Hello. My team and I are experiencing a similar issue.

For now, here is our findings

perquisites

  • We work through VSCode’s Remote Explorer .
  • We forward the port through VSCode.

Different approaches to reaching this issue and results

  • This only happens when running dev
  • Requesting the Nuxt server through localhost on the same machine as where the Nuxt server is running loads instantly
  • Requesting the Nuxt server through localhost with port forwarding through VSCode from another machine than the one hosting the Nuxt server yields the issue we have here.
  • Requesting Nuxt server by IP address loads instantly on both machines.

We have now tried both Nuxi 3.8.3 and 3.8.4 but the issue persists

What we think is happening so far

  • VSCode’s port forwarding is somehow slowing things down, since it loads instantly if we request it from the same machine that it’s hosted from, cutting off the VSCode forwarding.

I think I’ve seen a similar issue and the workaround until this is fixed is using 127.0.0.1:3000 instead of localhost:3000. Maybe that works for you

tysm, it worked for me