From b99000c567e277c2176e12d47222e19ad171108b Mon Sep 17 00:00:00 2001 From: Bruno Calou Date: Sat, 1 Oct 2022 13:48:14 -0300 Subject: [PATCH] fix: detach node just if parent node exists --- src/runtime/internal/dom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index d359513eb4..b71fc88a6d 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -204,7 +204,7 @@ export function insert_hydration(target: NodeEx, node: NodeEx, anchor?: NodeEx) } export function detach(node: Node) { - node.parentNode.removeChild(node); + node.parentNode?.removeChild(node); } export function destroy_each(iterations, detaching) {