diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 481fb7d74a..7df8fcf45c 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -7,7 +7,7 @@ export function insert(target: Node, node: Node, anchor?: Node) { } export function detach(node: Node) { - node.parentNode.removeChild(node); + if (node.parentNode) node.parentNode.removeChild(node); } export function destroy_each(iterations, detaching) {