question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. Create an empty Vue project with the webpack template.
  2. Open App.vue and wrap the <hello> component in a <keep-alive>.
  3. Run the dev server.
  4. Modify the script section of Hello component (modifying the template doesn’t trigger the issue).
  5. 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:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Drumstix42commented, Aug 6, 2020

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?

1reaction
dwatts3624commented, Jul 15, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found