-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
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 utils propagateUpdate to traverse the files dependency tree and if find a circular dependency, returns true to triggers a full page reload,
My proposal is, instead of return a boolean, updateModules could return ModuleNode | undefined, if returns a ModuleNode, triggers a page reload, and send a message with the module and the importers
Alternative
No response
Additional context
I have been migrating from create-react-app@5 to vite@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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.