Skip to content

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

@johanrd

Description

@johanrd

I see the error Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node popping up in sentry from time to time. I have yet to reproduce it when I try, but I know it freezes the whole UI when it happens.

Screen Shot 2022-11-25 at 13 07 14

It is not a very viable solution to tell users to uninstall various chrome extensions and/or not use google translate in order to not break a glimmer app. This has occurred both on Chrome and Edge.

Is it possible with a more resilient handling in clearElement?

export function clearElement(parent: SimpleElement) {
let current: Option<SimpleNode> = parent.firstChild;
while (current) {
let next = current.nextSibling;
parent.removeChild(current);
current = next;
}
}

Perhaps a try-catch? Or will that disturb some other inner workings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions