core
core copied to clipboard
Fix: HMR on keepalive components caused error (fix #5073)
close #5073
Found this PR because yes, indeed, HMR is broken if I add keep-alive on the router-view.
That's the error:

I haven't tried applying the fix proposed in this PR, but 🤞🏼 that it's about the same issue :)
Whether the problem has been solved and repaired, and whether the latest version has been solved. At present, I use "Vue": "^ 3.2.13"; The problem still exists
Can this get some attention, please? Working without HMR is extremely annoying.
@yyx990803 This problem has existed for a long time. there is a complete test case in hmr.spec.ts,at present, the latest version of Vue test cannot pass, although it is a small bug,but it is really annoying in development. please pay some attention to it, Thank you
Deploy Preview for vue-next-template-explorer ready!
| Name | Link |
|---|---|
| Latest commit | 7f3a64e0e50ec9887742c69db6b0a3daad8ffd80 |
| Latest deploy log | https://app.netlify.com/sites/vue-next-template-explorer/deploys/627615e2c7c5b300088cbe8f |
| Deploy Preview | https://deploy-preview-5165--vue-next-template-explorer.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Deploy Preview for vuejs-coverage ready!
| Name | Link |
|---|---|
| Latest commit | 7f3a64e0e50ec9887742c69db6b0a3daad8ffd80 |
| Latest deploy log | https://app.netlify.com/sites/vuejs-coverage/deploys/627615e2b3c7da00085f88e4 |
| Deploy Preview | https://deploy-preview-5165--vuejs-coverage.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Deploy Preview for vue-sfc-playground ready!
| Name | Link |
|---|---|
| Latest commit | 7f3a64e0e50ec9887742c69db6b0a3daad8ffd80 |
| Latest deploy log | https://app.netlify.com/sites/vue-sfc-playground/deploys/627615e2d1fdbb000894a878 |
| Deploy Preview | https://deploy-preview-5165--vue-sfc-playground.netlify.app/ |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
@yyx990803 尝试了3.2.37版本,这个问题依然存在,希望能在下个版本中看到它被修复了,虽然刷新一下浏览器,它就没问题了,但每次热更它总出现在控制台里,很烦人, #4387 #5073 都是这个问题,谢谢了。
The first reload didn't trigger the onDeactivated.
I find that this problem does not occur when using the option API. Only when using the setup API will the hot update fail!
I tried [email protected] version and still have this error
实测3.2.45已经没有提示该错误
Thanks for your PR, but this issue has been fixed in v3.2.45, see #7049.
still getting this error on 3.2.45
still getting this error on ^3.2.47
still getting this error on ^3.3.4