Skip to content

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. #3406

@zigomir

Description

@zigomir

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions