Subscribe on changes!

HMR not working after failed hydration

avatar
Feb 13th 2023

Vue version

3.2.45

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-knf34v?file=App.vue

Steps to reproduce

Сhange a value e.g. const a = ref(2)

What is expected?

Value is changed on the web page

What is actually happening?

HTML is removed from <div id="app" />

System Info

No response

Any additional comments?

No response

avatar
Apr 27th 2023

During HMR reload, the div element is unmounted. However, in SSR mode, the mountComponent process does not remount the div element but hydrates it instead, causing the issue of the div element being deleted.