-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
HMR with an external script does not proper reload #8
Comments
I was not able to reproduce with your repro. Does it only happen in a specific environment? And does it still happen with Vite 3? |
Hello @cub. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Uncomment the chrome_gm2Rm8407q.mp4 |
And yes @sapphi-red , it still happen with Vite 3 |
Still happen with |
This issue is still happening. When you first start vite, you'll be able to change content in ts file and it will update, but after making a change to anything within the vue template if you change anything within the ts file that the template references vite says it updated but no updates are actually made to the page. |
The issue seems to stem from the following line in main.ts: // check if the template is the only thing that changed
if (prevDescriptor && isOnlyTemplateChanged(prevDescriptor, descriptor)) {
output.push(`export const _rerender_only = true`)
} A temporary workaround is to change Maybe add a setting to vite to allow cache disabling? |
duplicate of #7. please try these pre-releases packages. |
Describe the bug
I have a problem with HMR with Vue. When I modify my external script, HMR reload the .vue but stay in an old state.
I see in the console the warning
[Vue warn]: Property "qqq" was accessed during render but is not defined on instance.
, it's normal.Then I uncomment
qqq:'weeeeeeee'
and save the .ts.I see in the console
[vite] hot updated: /src/components/test-hmr/test-hmr.vue
.But the render is not showing the
weeeeeeee
, it's stuck with the not defined previous state.On the very first load, it reload/refresh nicely. If you rename the
qqq
to something else in the .vue, save, then edit accordingly the .ts, it will stuck in previous state.Note, if I insert the content of my .ts inside the
<script>
, the HMR works well.The problem only occurs with external script file.
Reproduction
https://github.com/cub/test-hmr
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: