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

nuxi dev causes requests to stay "Pending" #279

Open
hendrikheil opened this issue Nov 3, 2023 · 4 comments
Open

nuxi dev causes requests to stay "Pending" #279

hendrikheil opened this issue Nov 3, 2023 · 4 comments

Comments

@hendrikheil
Copy link

hendrikheil commented Nov 3, 2023

We've just discovered some behavior that causes our projects to completely stop working after the first request.

To give some context, we currently have our projects on nuxt v3.6.5. After updating to latest nuxt (currently 3.8.0), our apps start to have around 10% of their requests stuck in "Pending" when checking out the network tab in Chrome DevTools.

We've been able to isolate the issue to 3.7.0, as thats the version when this starts happening. More specifically, we traced it to nuxi v3.7.0. Whenever we override nuxt's dependency on nuxi to v3.6.5, all works just like expected.

We're seeing this irrelevant of OS (we tested MacOS and Linux) and Node version (we tested 18 and 20).

In our case, something causes every date-fns and lodash-es function to be imported as a single request, meaning we end up making 1.2k requests to load our SPA. The first request usually works just fine, however any requests after are partially stuck in "Pending", some seem to resolve after a delay of 30s. As soon as there are requests that get into the Pending state, we don't really leave the spa-loading-template content anymore and can't do anything with the apps.

For now the workaround is to pin nuxi, but that doesn't seem like a good solution. We could also spend more time to figure out why we there are so many requests in the first place, but even then 1200 local requests on a machine don't seem like they should be a bottle neck at all.

Before we dive super deep into this, is there anybody that has experienced this too?
We'll try to provide a reproduction repo of course.

Might be related to #209

@hendrikheil
Copy link
Author

Just confirmed this, using --no-fork completely resolves the issue for us. We don't need to pin anymore, but maybe a reproduction from our case is still a good idea? @pi0

@pi0
Copy link
Member

pi0 commented Nov 3, 2023

We are aware of some possible scenarios that this might happen with forked dev server and already plan to make some attempts fixing it (using socket file).

But any reproduction or environment info (os, using ipv6 or not, node version, using any specific listener options or package manager, etc) would be super helpful since i still have no stable reproduction.

Also feel free to DM me in discord (pi0) if you like to directly show me your project.

@Ashlayyy
Copy link

Has there been any updates about this issue? I have this problem too. If it is needed I could provide some information about my environment or specific options I have used?
I have noticed however that this issue is also there on a brand new project using npx nuxi@latest init <project-name>

@Talla2XLC
Copy link

Talla2XLC commented May 24, 2024

I have the same issue on Windows 11 OS using nuxt 3.11.2.
SSR + https dev server with self-signed certificate.
Only switching to 127.0.0.1 instead of localhost can help but in my case I can`t switch localhost for project due to infrastructure reasons
--no-fork flag also helps but maybe there is another way to fix in a civilized way?

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

No branches or pull requests

4 participants