You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is related to #131, and is the same one described in vuejs/core#4757.
For example, in a Vue app with Vue Router:
When a page component file is modified, if the page:
is the current route HMR works.
is not the current route, HMR does not work
As a result, when modifying a component that is not the current route, the HMR update is sent as usual, but because the component has no active instances, the Vite client does not update the module.
If the modified page component has already being imported, when its route is visited, the original module is used, which doesn't include the changes since it was never updated by HMR.
It's not specific to Vue Router though, it could happen for any development flow where a component is imported, but it might not have an active instance.
For example:
<Welcome v-if="condition"/>
If Welcome.vue is modified when the condition is false, then once the condition is true, an outdated version of the component will be rendered.
The reason I mention Vue Router first, is that it's a very typical way for users to experience the bug.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
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.
Since plugin-vue is still providing _sfc_main as a second parameter to the HMR createRecord function, it's likely that it can be fixed in vue-next instead.
Describe the bug
This bug is related to #131, and is the same one described in vuejs/core#4757.
For example, in a Vue app with Vue Router:
When a page component file is modified, if the page:
As a result, when modifying a component that is not the current route, the HMR update is sent as usual, but because the component has no active instances, the Vite client does not update the module.
If the modified page component has already being imported, when its route is visited, the original module is used, which doesn't include the changes since it was never updated by HMR.
It's not specific to Vue Router though, it could happen for any development flow where a component is imported, but it might not have an active instance.
For example:
If
Welcome.vue
is modified when the condition is false, then once the condition is true, an outdated version of the component will be rendered.The reason I mention Vue Router first, is that it's a very typical way for users to experience the bug.
Reproduction
github.com
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: