Subscribe on changes!

Throw "TypeError: Cannot read property 'nextSibling' of undefined" on vite hmr

avatar
Jul 11th 2021

Version

3.1.4

Reproduction link

https://github.com/ycs77/vue-3.1.3-hmr-bug-demo

Steps to reproduce

  1. yarn
  2. yarn dev and open browser: http://localhost:3000
  3. open src/App.vue
  4. replace line 3 class max-w-screen-sm to max-w-screen-md and save file
  5. replace line 3 class max-w-screen-md to max-w-screen-lg and save file

What is expected?

hmr working, and no throw errors

What is actually happening?

Throw error: "TypeError: Cannot read property 'nextSibling' of undefined"


this bug exists in both v3.1.3 and v3.1.4

if downgrading vue and @vue/compiler-sfc to v3.1.2 will no this bug

avatar
Jul 12th 2021

I didn't reproduce the bug.

  1. download your repro
  2. remove yarn.lock
  3. update both vue and vue/compiler-sfc to 3.1.4
  4. yarn
  5. yarn dev
  6. replace line 3 class max-w-screen-sm to max-w-screen-md and save file

works fine. This bug has already fixed in https://github.com/vuejs/vue-next/commit/fded1e8dfa22ca7fecd300c4cbffd6a37b887be8

avatar
Jul 12th 2021

@edison1105 Need to modify 2 times and save

  1. replace line 3 class max-w-screen-sm to max-w-screen-md and save file
  2. replace line 3 class max-w-screen-md to max-w-screen-lg and save file
  3. look the error message: console-shotcut
avatar
Jul 12th 2021

@ycs77
uh~ sorry for that. I will check it later.

avatar
Jul 15th 2021

fixed by c0db8078

avatar
Jul 16th 2021

fixed by c0db807

Can I use that commit now? I have same problem.

avatar
Jul 16th 2021

fixed by c0db807

Can I use that commit now? I have same problem.

not release yet