admin管理员组文章数量:1399490
I have build an web application using Vue.js v2.5.1 for the front-end. The application works well generally, but when there is a problem, the error messages that get thrown only reference the vue.js code itself rather than the parts of my code (I assume something in my templates) that are no doubt the actual source of the problem.
Here is an example:
Error in nextTick: "NotFoundError: Failed to execute 'insertBefore' on
'Node': The node before which the new node is to be inserted is not a
child of this node."
warn @ vue.js?v=1:491
logError @ vue.js?v=1:600
globalHandleError @ vue.js?v=1:595
handleError @ vue.js?v=1:584
(anonymous) @ vue.js?v=1:735
nextTickHandler @ vue.js?v=1:685
vue.js?v=1:604 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.
at Object.insertBefore (.js?v=1:5138:20)
at updateChildren (.js?v=1:5628:48)
at patchVnode (.js?v=1:5695:41)
at updateChildren (.js?v=1:5592:21)
at patchVnode (.js?v=1:5695:41)
at updateChildren (.js?v=1:5592:21)
at patchVnode (.js?v=1:5695:41)
at updateChildren (.js?v=1:5592:21)
at patchVnode (.js?v=1:5695:41)
at updateChildren (.js?v=1:5592:21)
How can I use this to get to the source of the problem? I have tried using Vue devtools, but all the dev tools show is a list of all my Vue ponents, the events pane is always empty whatever I do.Whats worse is that when this error occurs, then the whole application grinds to a halt (but the vue data all looks ok still).
I have build an web application using Vue.js v2.5.1 for the front-end. The application works well generally, but when there is a problem, the error messages that get thrown only reference the vue.js code itself rather than the parts of my code (I assume something in my templates) that are no doubt the actual source of the problem.
Here is an example:
Error in nextTick: "NotFoundError: Failed to execute 'insertBefore' on
'Node': The node before which the new node is to be inserted is not a
child of this node."
warn @ vue.js?v=1:491
logError @ vue.js?v=1:600
globalHandleError @ vue.js?v=1:595
handleError @ vue.js?v=1:584
(anonymous) @ vue.js?v=1:735
nextTickHandler @ vue.js?v=1:685
vue.js?v=1:604 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.
at Object.insertBefore (https://mywebsite./js/vendor/vue.js?v=1:5138:20)
at updateChildren (https://mywebsite./js/vendor/vue.js?v=1:5628:48)
at patchVnode (https://mywebsite./js/vendor/vue.js?v=1:5695:41)
at updateChildren (https://mywebsite./js/vendor/vue.js?v=1:5592:21)
at patchVnode (https://mywebsite./js/vendor/vue.js?v=1:5695:41)
at updateChildren (https://mywebsite./js/vendor/vue.js?v=1:5592:21)
at patchVnode (https://mywebsite./js/vendor/vue.js?v=1:5695:41)
at updateChildren (https://mywebsite./js/vendor/vue.js?v=1:5592:21)
at patchVnode (https://mywebsite./js/vendor/vue.js?v=1:5695:41)
at updateChildren (https://mywebsite./js/vendor/vue.js?v=1:5592:21)
How can I use this to get to the source of the problem? I have tried using Vue devtools, but all the dev tools show is a list of all my Vue ponents, the events pane is always empty whatever I do.Whats worse is that when this error occurs, then the whole application grinds to a halt (but the vue data all looks ok still).
Share Improve this question asked Nov 30, 2017 at 20:13 William HolmesWilliam Holmes 611 silver badge2 bronze badges3 Answers
Reset to default 6If you are doing conditional rendering on an element in an template that is being embedded somewhere and you are using v-if
try to use v-show
instead.
i.e.
<template>
<div id="remote">
<span v-show="disable===true" v-on:click="enableInput"> {{account_pany_name}} </span>
<div v-show="disable===false">
<Span><i>Tip: Press Enter to save</i></Span>
<input
type="text"
v-model.lazy="account_pany_name"
v-on:keyup.enter="disableInput">
</div>
</div>
</template>
Found this error too, pushing a route change inside a mutation when the state change wasn't pleted. Wrapping the route change push in Vue.nextTick()
solved it.
i had this error before.
in my project ,i figure out that when i deleting some element from dom and then refreshing the dom this error occur, actually i delete a record which was a tr element from vuetable and then refresh that vuetable .after this proccess my vuetable didnt work for me and your error appeared in my console so i decided delete my tr with another way!
So if you are working with dom, choose another way . for exmple if you are using v-if try v-show !! or if you are using this code
event.target.closest("tr").remove()
try another way.
本文标签: javascriptIssue with Vuejs debugging messagesStack Overflow
版权声明:本文标题:javascript - Issue with Vue.js debugging messages - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744218514a2595751.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论