-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[3.17.0-beta] Destroying -in-element: Failed to execute 'removeChild' on 'Node'
#18696
[3.17.0-beta] Destroying -in-element: Failed to execute 'removeChild' on 'Node'
#18696
Comments
There have been changes to the |
@pzuraq I have created a reproduction here: https://github.com/simonihmig/in-element-reproduction This fails even when taking the new semantics ( To reproduce it seems these preconditions need to come together:
The latter point is easy to see in the failing test here, as the (passing) first test is identical except for the white space! Note: both tests pass for Ember 3.16.0 (when removing the unsupported |
I ran into this issue (Skylight tests currently failing on beta) with a similar setup. I think the problem is that we are using I think it boils down to something like this: {{!-- application.hbs --}}
<header>First</header>
{{!-- in practice this happens somewhere deeper in the app, but shouldn't matter --}}
{{#-in-element ($ ".ember-application") insertBefore=null}}
<div>Middle</div>
{{/-in-element}}
<footer>Last</footer> Which results in this DOM output: <header>First</header>
<div>Middle</div>
<footer>Last</footer> The Based on my initial reading of the code, I'm a bit worried that this is a bigger problem that affects more than just |
Chatted about this in today's framework meeting, @pzuraq mentioned he would try to dig into this next week... |
never mind, I was just testing it wrong! |
I tested it with my reproduction repo to make sure, but indeed it did not fix the issue! |
This usually happens when the app uses `{{in-element}}` to append to `Ember.Application.rootElement` during initial render, which causes Glimmer to (incorrectly) include the "remoted content" in the root render result. When the render result is torn down, the "remoted content" gets removed as well, and so by the time its destructor runs it will be trying to clear its content again, which causes the double-clearing error ("The node to be removed is not a child of this node." in "removeChild"). This is probably a better fix to how Glimmer views the boundaries it manages, but this should be sufficient to supress the error for now without too much undesirable side-effects. Fixes emberjs/ember.js#18696 Co-authored-by: Yehuda Katz <[email protected]>
This usually happens when the app uses `{{in-element}}` to append to `Ember.Application.rootElement` during initial render, which causes Glimmer to (incorrectly) include the "remoted content" in the root render result. When the render result is torn down, the "remoted content" gets removed as well, and so by the time its destructor runs it will be trying to clear its content again, which causes the double-clearing error ("The node to be removed is not a child of this node." in "removeChild"). This is probably a better fix to how Glimmer views the boundaries it manages, but this should be sufficient to supress the error for now without too much undesirable side-effects. Fixes emberjs/ember.js#18696 Co-authored-by: Yehuda Katz <[email protected]>
@simonihmig can you test this again on beta or canary? |
@chancancode Did so, and can confirm the exception does not occur anymore, both in the reproduction and in the I do see another issue for beta/canary, but this seems to be a different thing I need to investigate... |
Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
This error is thrown since
3.17.0-beta
(IIRC also in canary versions before), apparently when destroying an-in-element
. I did not dig into this, but all tests ofember-bootstrap
that involve-in-element
(modals, dropdowns, tooltips, popovers) are failing with that error.To confirm I just triggered a rebuild of
ember-popper
- which also uses-in-element
- and the same failing tests there.Btw, both addons use
ember-maybe-in-element
, but I believe this should not matter as it is a build-time AST transform.Likely related to #18621
/cc @pzuraq @cibernox
The text was updated successfully, but these errors were encountered: