-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
Describe the bug
We unravelled a bug recently in our application with HMR. When we change a single .vue file it throws an error like this one:
This sounds like a circular dependency bug so we started trying to find it... but after some investigation we noticed this error message only shows up in vite@2.0.0-beta.34 and later.
This commit is the one we are looking at:
ca8442c
Here's are two videos:
-
showing what's happening on 2.0.0-beta.33: everything works correctly, the change is update live and does not throw any error
https://user-images.githubusercontent.com/4596409/121266195-12b6a800-c888-11eb-9724-20c996aa8e12.mov -
showing what's happening on 2.0.0-beta.34: here the whole importer chain is invalidated.
https://user-images.githubusercontent.com/4596409/121266365-63c69c00-c888-11eb-8c4d-c35fda601514.mov
Not only it throws an error, but it seems inefficient to invalidate the whole chain just to propagate one change on a component.
We didn't notice the bug until today despite running latest vite (2.3.6) because the error is thrown only on this component. I guess because it has a specific set of importers/deps that are not playing well with this whole invalidation process.
Thanks
Reproduction
Right now, this is very difficult to provide a minimal repro, because the bug is probably only showing up at scale. Waiting for your feedback before doing anything.
System Info
Not relevant I think
Logs
Before submitting the issue, please make sure you do the following
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Provide a description in this issue that describes the bug.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.