DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
See original GitHub issueVue.js version
2.0.0-beta.7
Steps to reproduce
Use browserify-simple-2.0
or webpack-simple-2.0
vue cli template with hot module replacement. Hard reload won’t reproduce this issue.
<template>
<div id="app">
<div v-for="item in 10">
<!-- Without :key in span tag, when you reduce the range (e.g.: from 10 to 5) error will occur. When increasing range error is not present. -->
<span>M</span>
<!-- <span :key="item">M</span> -->
</div>
</div>
</template>
What is Expected?
Use hmr without a need to use :key on static element?
What is actually happening?
DOMException: Failed to execute ‘insertBefore’ on ‘Node’: The node before which the new node is to be inserted is not a child of this node. is thrown whenever you reduce v-for
range and you don’t provide :key
property to static element inside v-for
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Uncaught NotFoundError: Failed to execute 'insertBefore' on ...
Uncaught NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child...
Read more >Failed to execute 'insertBefore' on 'Node': The node ... - GitHub
Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this...
Read more >Failed to execute 'insertBefore' on 'Node' - Vue Forum
Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this...
Read more >error domexception: failed to execute 'insertbefore' on 'node'
Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this...
Read more >DOMException: Failed to execute 'insertBefore' on ... - Laracasts
DOMException : Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@moonlik I had the same issue, and moved the component call at the top of the template and it worked…
Please dont comment on old, closed(!) issues over and over. The original issue was fixed, so if your problem is a bug, it’s likely not the same thing, and you should either ask for help on the forum or open a new issue for a proper bug report with an interactive reproduction.