You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clicking the button causes the following exception to be thrown in the Chrome Version 55.0.2883.95 (64-bit) console
DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at Object.removeChild (https://unpkg.com/[email protected]/dist/vue.js:3825:8)
at removeVnodes (https://unpkg.com/[email protected]/dist/vue.js:4188:19)
at patchVnode (https://unpkg.com/[email protected]/dist/vue.js:4333:9)
at updateChildren (https://unpkg.com/[email protected]/dist/vue.js:4252:9)
at patchVnode (https://unpkg.com/[email protected]/dist/vue.js:4328:29)
at Vue$3.patch [as __patch__] (https://unpkg.com/[email protected]/dist/vue.js:4451:9)
at Vue$3.Vue._update (https://unpkg.com/[email protected]/dist/vue.js:2224:19)
at Vue$3.<anonymous> (https://unpkg.com/[email protected]/dist/vue.js:2191:10)
at Watcher.get (https://unpkg.com/[email protected]/dist/vue.js:1656:27)
at Watcher.run (https://unpkg.com/[email protected]/dist/vue.js:1725:22)
and all JS execution stops (this is proven by the fact the time does not update with repeated clicks).
Notes
Strangely, the error doesn't happen if you drop the style attributes from the two divs.
Salutation
Thanks! Best regards,
Eric
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. It seems that Vue tries to re-use the div element instead of removing one and adding the other (Re-using elements is generally preferred for performance reasons), but messes up in the process.
Seems to be a bug indeed.
A better workaround would be to explicitly key the elements with a key (unique in the component's scope) to force Vue to actually replace the divs:
Uh oh!
There was an error while loading. Please reload this page.
Vue.js version
2.1.6
Reproduction Link
http://jsfiddle.net/od3m0ta9/
Steps to reproduce
Given the following code
clicking the button causes the following exception to be thrown in the Chrome Version 55.0.2883.95 (64-bit) console
and all JS execution stops (this is proven by the fact the time does not update with repeated clicks).
Notes
Strangely, the error doesn't happen if you drop the style attributes from the two divs.
Salutation
Thanks! Best regards,
Eric
The text was updated successfully, but these errors were encountered: