Skip to content

[Teleport] - Updating component inside Teleport causes HMR to crash #12816

Closed
@nunoraposo33

Description

@nunoraposo33

Vue version

3.5.13

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-grzg8vpe?file=src%2FApp.vue

Steps to reproduce

In App.vue update the slot content to anything else.
Also happens if you change the "Modal.vue", as an example change the class "modal__dialogs" to "modal_potatos".

In the browser's console it shows:
TypeError: Cannot set properties of null (setting '__vnode')

It's related to reactivity inside the component Modal.vue, in the computed "modalClasses", remove the reference to the ref "isVisible" and the error will not happen, or if the value of "isVisible" is set as "true" (line 16).

// Not sure if the title is accurate

What is expected?

I expect the modal component's hot reload to work normally.

What is actually happening?

Hot reload stops working after the error, need to refresh the page.

System Info

Using the stackblitz stack.

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problemscope: hmr

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions