Hot reload doesn't drop the old component if it's wrapped in <keep-alive>
See original GitHub issue(not sure if I’ve chosen the appropriate bug tracker for this)
Steps to reproduce:
- Create an empty Vue project with the
webpack
template. - Open
App.vue
and wrap the<hello>
component in a<keep-alive>
. - Run the dev server.
- Modify the script section of
Hello
component (modifying the template doesn’t trigger the issue). - See Components tab in vue-devtools.
Expected behavior: the wrapped component is replaced with the new version. Observed behavior: the old version is kept alive, and each change results in an additional inactive component.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Hot Reload is not working in my React App - Stack Overflow
To solve the problem in hot reloading/fast_refresh I simply add CHOKIDAR_USEPOLLING=true in package.json:
Read more >Basic Features: Fast Refresh - Next.js
Next.js' Fast Refresh is a new hot reloading experience that gives you instantaneous feedback on edits made to your React components.
Read more >REsource LOcation And Discovery (RELOAD) Base Protocol
1. USER-MATCH In the USER-MATCH policy, a given value MUST be written (or overwritten) if and only if the signer's certificate has a...
Read more >Configuration - Purpur Documentation
yml file. If you want information on settings in paper.yml, spigot.yml, bukkit.yml and server.properties you should see their respective documentation pages ...
Read more >Troubleshoot Common L2L and Remote Access IPsec VPN ...
If you configure ISAKMP keepalives, it helps prevent sporadically dropped LAN-to-LAN or Remote Access VPN, which includes VPN clients, tunnels and the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s a shame this issue still exists. I’ve just run into the bug as well. Do we know if this will be fixed/addressed in Vue 3?
I posted this in #1332 but wanted to share here.
I ended up rolling the comments from @nailfar & @ericwu-wish into a plugin: https://www.npmjs.com/package/vue-keep-alive-dev
As mentioned on the other thread, I’m still wondering if it might be easier just to always append the value of
componentOptions.Ctor.cid
to the cache key. This is a lot of extra code for what is ultimately a small modification to a single line which doesn’t have any negative affect in production.