-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
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
Comments
@yyx990803 I have the same issue with the modal window. Don't know what I'm doing wrong Vue.js version2.1.6 Steps to reproduceUse vue-loader v10.0.0 Modal.vue <template>
<div class="modal is-active has-text-centered">
<div class="modal-background"></div>
<div class="modal-card">
<section class="modal-card-body">
<slot></slot>
</section>
</div>
<button class="modal-close" @click="$emit('close')"></button>
</div>
</template>
<script>
export default {
mounted () {
document.getElementById('app').appendChild(this.$el)
}
}
</script> Something.vue <template>
<section class="section">
<div class="container">
<modal v-if="showModal" @close="showModal = false">
<p>Some text here</p>
</modal>
<a class="button is-primary modal-button" @click="showModal = true">Show modal</a>
</div>
</section>
</template>
<script>
import Modal from './ui/Modal'
export default {
data: function () {
return {
showModal: false
}
},
components: {
Modal
}
}
</script> What is Expected?When click on the close button, it should close the modal window. What is actually happening?Console shows me the error |
@moonlik Please follow the Issue Reporting Guidelines and provide a live reproduction on jsfiddle, codepen etc, then open a separate issue. Thanks! |
@fnlctrl ok, sorry. |
@moonlik I had the same issue, and moved the component call at the top of the template and it worked… |
I'm having the same problem my store.js const state = {
forms : []
}
const mutations = {
ADD_FORM (state, newForm) {
state.forms.push(newForm)
}
}
const actions = {
listForm: (context) => {
Vue.http.get('form_models').then(resp => {
$.each(resp.body, (i, data) => {
const form = {
id : data._id
, data: data.data
, html: data.html
}
context.commit("ADD_FORM", form)
})
})
}
} my component.vue <template>
<table>
<tbody>
<tr v-for="(form,index) in forms"></tr>
</tbody>
</table>
</template>
<script>
export default {
created(){
this.$store.dispatch('listForm')
}
, computed: {
forms(){
return this.$store.state.easyForms.forms
}
}
}
</script>
How to solve this problem ? |
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. |
Vue.js version
2.0.0-beta.7
Steps to reproduce
Use
browserify-simple-2.0
orwebpack-simple-2.0
vue cli template with hot module replacement. Hard reload won't reproduce this issue.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 insidev-for
.The text was updated successfully, but these errors were encountered: