Skip to content

HMR on keepalive components caused error #5073

Closed
@konpeki622

Description

@konpeki622

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions