Open the console and click on the button a few times, you'll see the error appear.
Possible Solution
At some point we removed the SLOT_ATTRIBUTE_CANNOT_BE_EXPRESSION warning which enables the slot attribute to be a dynamic value but the diffing algo was not updated to accomodate this change.
I briefly debugged this and I think the root cause is because the children are reused each time a slot vnode is generated.
Description
Using an expression for a
slot
attribute in synthetic shadow throws an error."DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."
Light DOM and Native shadow do not throw the same error.
Steps to Reproduce
Stackbliz repo here.
Open the console and click on the button a few times, you'll see the error appear.
Possible Solution At some point we removed the
SLOT_ATTRIBUTE_CANNOT_BE_EXPRESSION
warning which enables theslot
attribute to be a dynamic value but the diffing algo was not updated to accomodate this change.I briefly debugged this and I think the root cause is because the children are reused each time a
slot
vnode is generated.