question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Vue.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:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fabien-lgcommented, Dec 23, 2016

@moonlik I had the same issue, and moved the component call at the top of the template and it worked…

0reactions
LinusBorgcommented, Dec 30, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found