Unhelpful Re-render (Glimmer?) error message: `Failed to execute 'insertBefore' on 'Node'`
See original GitHub issueI’m polling for server changes using ember-concurrency. When new data arrives, I’m seeing Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
and the view isn’t re-rendered.
Not 100% certain that this is an ember bug, rather than me doing something silly, but given that the initial render works fine, and this only occurs when new data is added, this seems like it might be a problem with Glimmer’s DOM diffing (and, if this is expected behavior, a more helpful error message would certainly be appreciated 😃
Full traceback:
ember.debug.js:18008 Error: 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 Error (native)
at DOMChanges.insertBefore (http://localhost:4200/assets/vendor.js:66816:21)
at DOMChanges.insertAfter (http://localhost:4200/assets/vendor.js:66820:18)
at ListBlockOpcode.evaluate (http://localhost:4200/assets/vendor.js:70691:21)
at UpdatingVM.execute (http://localhost:4200/assets/vendor.js:70446:24)
at RenderResult.rerender (http://localhost:4200/assets/vendor.js:70385:16)
at RootState._this.render (http://localhost:4200/assets/vendor.js:27867:18)
at runInTransaction (http://localhost:4200/assets/vendor.js:39184:28)
at InteractiveRenderer._renderRoots (http://localhost:4200/assets/vendor.js:28128:48)
at InteractiveRenderer._renderRootsTransaction (http://localhost:4200/assets/vendor.js:28166:14)
defaultDispatch @ ember.debug.js:18008
dispatchError @ ember.debug.js:17987
invokeWithOnError @ ember.debug.js:349
flush @ ember.debug.js:405
flush @ ember.debug.js:529
end @ ember.debug.js:599
(anonymous function) @ ember.debug.js:1165
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Redux throwing error saying Failed to execute 'insertBefore ...
I am working on my react application and getting this error. Failed to execute 'insertBefore' on 'Node': The node before which the new...
Read more >Tagless component challenge after Glimmer update - Ember.JS
When the component eventually rerenders after an update, It fails with a similar error: DOMException: Failed to execute 'insertBefore' on 'Node ...
Read more >254144 - Iframe reloads when moved around the DOM tree.
This incorrect behavior can be observed any time an iframe node is pulled from the DOM tree and re-inserted, whether it is done...
Read more >Failed to execute 'insertBefore' on 'Node' error crashes ...
The below error is generated when start editing in gutenberg and it crashes. Error: Failed to execute 'insertBefore' on 'Node': The node before...
Read more >zxcvbn-async.js - Drupal
parentNode.insertBefore(b,a)};null!=window. ... mum,motion,fella,enemies,desert,collection,incident,failure,satisfied,imagination,hooked,headache,forgetting ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It was suggested in slack that this is likely being caused by my use of a JS tool that modifies the DOM directly, which seems likely to be a not-entirely-uncommon mistake. Having an error message that suggested possible causes of this failure would be helpful.
In the case of this particular lib, I’m able to work around the issue by manually supplying a wrapper element, so it doesn’t create it’s own internally. It’s not clear how I’d work around this in the general jquery plugin case, though. It might be worth updating the
didInsertElement
/didRender
docs to explain what can/cannot be done in each hook, along with the proper work-around (if one exists). Right now the docs for didRender say “You can leverage [the didRender] hook to perform post-processing on the DOM of a component after its been updated”, which seems to me to imply that what I was doing should workClosing for now (this is inactive) feel free to re-open if still needed.