Skip to content
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

whitespace: 'preserve' - TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node' #6853

Closed
eldair opened this issue Oct 11, 2022 · 2 comments

Comments

@eldair
Copy link

eldair commented Oct 11, 2022

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 #6849 (comment) but with proper reproduction.

@eldair eldair changed the title Preserve whitespace TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node' whitespace: 'preserve' - TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node' Oct 11, 2022
@zhangzhonghe
Copy link
Member

duplicate of #6852

This is because the line break between elements creates a blank text node, causing the same bug as #6852

@LinusBorg
Copy link
Member

closing in favor of #6852

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

No branches or pull requests

3 participants