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

waitForRequestsIdle hangs indefinitely when used in a Nuxt project #17980

Closed
7 tasks done
philipp-spiess opened this issue Aug 30, 2024 · 1 comment · Fixed by #17982
Closed
7 tasks done

waitForRequestsIdle hangs indefinitely when used in a Nuxt project #17980

philipp-spiess opened this issue Aug 30, 2024 · 1 comment · Fixed by #17982
Labels
p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)

Comments

@philipp-spiess
Copy link

philipp-spiess commented Aug 30, 2024

Describe the bug

When adding a Vite plugin inside a fresh Nuxt project, waitForRequestIdle on CSS assets will stall indefinitely.

Reproduction

https://github.com/philipp-spiess/vite-waitForRequestIdle-issue

Steps to reproduce

  • npm install
  • npm run dev
  • Go to the local dev server and observe the website stuck in loading state

System Info

System:
    OS: macOS 15.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 9.59 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.local/share/mise/installs/node/20.16.0/bin/node
    npm: 10.8.1 - ~/.local/share/mise/installs/node/20.16.0/bin/npm
    pnpm: 9.6.0 - ~/.local/share/mise/installs/pnpm/9.6.0/bin/pnpm
    bun: 1.1.26 - ~/.local/share/mise/installs/bun/1.1.26/bin/bun
    Watchman: 2024.08.05.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 128.0.6613.86
    Safari: 18.0
  npmPackages:
    vite: latest => 5.4.2

Used Package Manager

pnpm

Logs

No response

Validations

@patak-dev patak-dev added p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) and removed pending triage labels Aug 30, 2024
@patak-dev
Copy link
Member

Thanks for the reproduction @philipp-spiess! #17982 should fix this. We can merge it in the 5.x series before moving to the Vite 6 beta.

adamwathan pushed a commit to tailwindlabs/tailwindcss that referenced this issue Sep 4, 2024
We noticed that Nuxt projects were not working with the tailwindcss
project. The issue was traced down to the fact that Nuxt starts multiple
Vite dev servers and calling the experimental `waitForRequestsIdle()` on
one of the test servers would never resolve.

This was fixed upstream and is part of the latest Vite/Nuxt release:
vitejs/vite#17980.

We still need to handle the fact that Vite can spawn multiple dev
servers. This is necessary because when we invalidate all roots, we need
to find that module inside all of the spawned servers. If we only look
at the _last server_ (what we have done before), we would not find the
module and thus could not invalidate it.
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants