GB-G
Convex Community7mo ago
2 replies
GB-

Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node

I'm not sure if this is a Covex issue or just React. I suspect the latter but hoping someone can help.

I am using dnd-kit to create a UI that you can move items within a sortable list. After dropping an item, a mutation takes place to update the Convex DB. This works great with a single list. I also have some items that can contain nested items. If I move an item into the container within another item, I think dnd-kit is updating the dom, the mutation takes place, then the convex query sees the data has changed and tries to update the dom again and gives this error:
Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node


I think it's because the node has already been removed by dnd-kit. Is there a way around this? Is there some way to tell the Covex query to ignore the error if something has already moved?
Was this page helpful?