Describe the bug
My understanding is that the code here is designed to remove the Svelte node from the tree when component.$destroy() is called. This line is throwing an error for me in the case where the node doesn't have a parent, because it has been created with the new Component({ target: <domNode>}, { ... }) syntax.
To Reproduce
Steps to reproduce the behavior:
Create a new component:
// Test.svelte
<div>test</div>
Create it programmatically, then destroy it
// App.svelte
onMount(() => {
let div = document.createElement("div");
div.id = "bug_example";
let component = new Test({ target: div });
document.body.appendChild(div);
component.$destroy();
}
You will get something like
Expected behavior
I believe all that needs to be done is to return early if node.parent is null.
Environment
Chrome Version 90.0.4430.212 (Official Build) (x86_64)
Devtools version 1.3.0
Svelte version 3.38.2
Additional context
This has been a great tool so far! Let me know how else I can help.
Describe the bug My understanding is that the code here is designed to remove the Svelte node from the tree when
component.$destroy()
is called. This line is throwing an error for me in the case where the node doesn't have a parent, because it has been created with thenew Component({ target: <domNode>}, { ... })
syntax.To Reproduce Steps to reproduce the behavior:
Create it programmatically, then destroy it
Expected behavior I believe all that needs to be done is to return early if
node.parent
is null.Environment
Additional context This has been a great tool so far! Let me know how else I can help.