Skip to content
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

fix: fix error with removing child node #208

Merged
merged 1 commit into from
Aug 17, 2023
Merged

Conversation

nolanlawson
Copy link
Contributor

@nolanlawson nolanlawson commented Aug 16, 2023

In ui-help-components, for some reason the line

node.removeChild(child)

... fails with the error

PrettyFormatPluginError: The node to be removed is not a child of this node.
  NotFoundError: The node to be removed is not a child of this node.

I debugged, and the error comes from JSDOM here. And it's bizarre, because child.parentNode === node and node.childNodes[0] === child, so one is definitely a child of the other.

In any case, changing this to child.remove() fixes the error. 🤷

Copy link
Contributor

@abdulsattar abdulsattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. Well, as long as it works, LGTM.

@nolanlawson nolanlawson merged commit d077e5d into master Aug 17, 2023
@nolanlawson nolanlawson deleted the nolan/child-node branch August 17, 2023 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants