-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
warn if HMR failed due a circular dependency issue #7893
Comments
Related #3033 |
This would be awesome, I spent way too much time figuring out what's wrong after migrating from CRA.
To quickly refactor all type imports with
then run eslint with Also related #10208 |
We recently migrated a large Vue app from Vue CLI (Webpack) to Vite. This issue has been the biggest pain point for us. Tools like madge are very helpful in finding circular dependencies, but it doesn't work with Vue single file components out of the box. Even after implementing a solution to find circular dependencies with This is a big deal to our team, please consider implementing this. |
I have the same issue with React app after migrating from CRA to Vite |
#2466 try this, may be help |
Clear and concise description of the problem
Vite's HMR fails if in some point of the dependency tree find a circular dependency issue, and then as a fallback triggers a ful l page reload, but the user doesn't get some info to be able to fix the issue
Suggested solution
If the HMR fails due a circular dependency, display a message for users about it
updateModules
uses a utilspropagateUpdate
to traverse the files dependency tree and if find a circular dependency, returnstrue
to triggers a full page reload,My proposal is, instead of return a boolean,
updateModules
could returnModuleNode | undefined
, if returns aModuleNode
, triggers a page reload, and send a message with the module and the importersAlternative
No response
Additional context
I have been migrating from
create-react-app@5
tovite@2.9.5
and this was annoying, I could't realized why HMR works with some files but not with others, I had to use ndb, and put a debugger here, then edit a file and debug the issue, I realized that I have a lot of circular dependency issues in my project 🙈Validations
The text was updated successfully, but these errors were encountered: