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

[Vite 3] Flaky Dev Server #8715

Closed
7 tasks done
brillout opened this issue Jun 22, 2022 · 4 comments
Closed
7 tasks done

[Vite 3] Flaky Dev Server #8715

brillout opened this issue Jun 22, 2022 · 4 comments

Comments

@brillout
Copy link
Contributor

Describe the bug

Vite 3 seems to introduce changes that make the dev server flaky.

Reproduction

https://github.com/vite-3-flaky-dev-server/vite-plugin-ssr

System Info

See reproduction's GitHub Actions.

Used Package Manager

pnpm

Logs

No response

Validations

@patak-dev
Copy link
Member

Thanks for creating the issue. Let us know once you find the problematic change in vite-plugin-ssr, as that may shed light in what is going to on Vite's side.
At least one of the CI issues was about optimized deps: https://github.com/vite-3-flaky-dev-server/vite-plugin-ssr/runs/7001960930?check_suite_focus=true
You could try to disable the scan free deps discovery using legacy.devDepsScanner: true. If CI is always green with that, it means that the new lazy discovery hides a race condition somewhere (that we could pin point once you find why vite-plugin-ssr was working before)

@brillout
Copy link
Contributor Author

That's helpful. Thanks.

Btw I see this:

[10:55:27.989][stdout][/examples/preact-server-routing][npm run dev] 10:55:27 AM[vite]✨ new dependencies optimized: preact, preact/hooks
[10:55:27.989][stdout][/examples/preact-server-routing][npm run dev] 10:55:27 AM[vite]✨ optimized dependencies changed. reloading
[10:55:28.064][Browser Error][/examples/preact-server-routing][npm run dev] {
  "type": "error",
  "text": "Failed to load resource: the server responded with a status of 504 (Gateway Timeout)",
  "location": {
    "url": "http://localhost:3000/node_modules/.vite/deps/chunk-5CVR5ZPT.js?v=f1c20c3b",
    "lineNumber": 0,
    "columnNumber": 0
  },
  "args": []
}
[10:55:28.065][Browser Error][/examples/preact-server-routing][npm run dev] {
  "text": "Failed to fetch dynamically imported module: http://localhost:3000/pages/index/index.page.jsx",
  "location": ""
}

Seems like the Vite dev server fails to provide a module after optimizeDeps is updated. It's flaky as well (i.e. it's sometimes green).

@patak-dev
Copy link
Member

A 504 here is normal after missing dependencies have been found. On-fly deps requests will respond with a 504 as these are outdated. The browser will reload the page and ask these again. Do you have code checking for these in the tests? It should ignore these 504 for deps.

@brillout
Copy link
Contributor Author

I can't reproduce this with the Vite 3 beta anymore.

Not sure what happened here 😅 but I won't complain :-).

I guess we can close this.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants