whitespace: 'preserve' - TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'
Vue version
3.2.40
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-rnarmx?file=src/App.vue
Steps to reproduce
Click on ID table header to sort rows.
If I remove
<tr v-if="false">
test
</tr>
everything works fine.
What is expected?
Rows to be sorted.
What is actually happening?
Errors are thrown:
Unhandled error during execution of scheduler flush. This is likely a Vue internals bug.
Uncaught (in promise) TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.
System Info
No response
Any additional comments?
This started happening in vue 3.2.40. (it worked fine in 3.2.39.)
It only happens if following is set in vue vite plugin options: whitespace: 'preserve'
This is the same issue as https://github.com/vuejs/core/issues/6849#issuecomment-1273853647 but with proper reproduction.
duplicate of #6852
This is because the line break between elements creates a blank text node, causing the same bug as #6852