Subscribe on changes!

HMR on `keepalive` components caused error

avatar
Dec 8th 2021

Version

3.2.24

Reproduction link

codesandbox.io

Steps to reproduce

  1. click go to bar and then click go to foo, to make the component Bar deactivated.
  2. click go to bar, modify the code line 18 in Bar.vue: const message = ref("test") -> const message = ref("any other words").

What is expected?

New message was shown.

What is actually happening?

TypeError: parentComponent.ctx.deactivate is not a function.


I have seen the similar issues and they do not resolve this problem. This issue was mentioned in the latest comment in #4387 . The parentComponent of Bar is itself instead of keep-alive When HMR occurs.

avatar
Dec 24th 2021

#5165, it can fix it, I add a test case to reappearance the situation this problem is related to cache of keep-alive

avatar
Jul 3rd 2022

@LinusBorg 请问这个问题有处理进展吗,官方是否修复了这个问题?

avatar
Dec 9th 2022

Duplicate of #6222 and #7042. This issue has been fixed in v3.2.45