Skip to content

HMR crashes with <teleport> in Vue SFC #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
8 of 9 tasks
adamsol opened this issue Mar 15, 2025 · 1 comment
Closed
8 of 9 tasks

HMR crashes with <teleport> in Vue SFC #546

adamsol opened this issue Mar 15, 2025 · 1 comment

Comments

@adamsol
Copy link

adamsol commented Mar 15, 2025

Related plugins

Describe the bug

The issue is triggered by assigning a simple variable on a button click. This variable is also passed as a prop to another element. There is an extra <div> inside <teleport>, which seems redundant, but the error actually disappears without it.

The error:

[email protected]:26 TypeError: Cannot set properties of null (setting '__vnode')
    at patchElement (vue.js?v=bd95302b:7030:18)
    at processElement (vue.js?v=bd95302b:6913:7)
    at patch (vue.js?v=bd95302b:6770:11)
    at patchKeyedChildren (vue.js?v=bd95302b:7681:9)
    at patchChildren (vue.js?v=bd95302b:7595:11)
    at patchElement (vue.js?v=bd95302b:7067:7)
    at processElement (vue.js?v=bd95302b:6913:7)
    at patch (vue.js?v=bd95302b:6770:11)
    at patchKeyedChildren (vue.js?v=bd95302b:7681:9)
    at patchChildren (vue.js?v=bd95302b:7595:11)

And warning:

vue.js?v=bd95302b:2626 [HMR] Something went wrong during Vue component hot-reload. Full reload required.

Reproduction

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

Steps to reproduce

  1. Open the link and wait for the page to load.
  2. Change something in App.vue - HMR works.
  3. Click the button.
  4. Change something in App.vue again - there's now an error in the browser console, and HMR no longer works.

System Info

System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 132.0.6834.196

Used Package Manager

npm

Logs

No response

Validations

@edison1105
Copy link
Member

duplicate of vuejs/core#12816

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants