Description
Somewhat related to #4446.
It turns out that slot forwarding is buggy in synthetic shadow DOM when using synthetic custom element lifecycle.
If you look in the DevTools console, you'll see an unhandled promise rejection:
Unhandled promise rejection: NotFoundError: Failed to execute 'removeChild' on 'Node':
The node to be removed is not a child of this node.
This is caused by this line:
Specifically when called in unmount
:
lwc/packages/@lwc/engine-core/src/framework/rendering.ts
Lines 464 to 468 in 9d207fb
This bug repros only in synthetic shadow, not native shadow. It repros with both native and synthetic custom element lifecycle.
The bug goes back to LWC v3.0.0 (at least), so it's probably been there for a while.
This is also repro'd by 5035243 and this test for #3827:
The best way to repro is to run DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn start
and look in the DevTools console.
Activity