From 3ff2e00aa08dc59334129c8d80254b372087355e Mon Sep 17 00:00:00 2001 From: jimafisk Date: Fri, 4 Dec 2020 15:34:20 -0500 Subject: [PATCH] allow document level hydration (#5547). --- src/runtime/internal/dom.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 91e575ebf630..f255f545aecb 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -5,7 +5,9 @@ export function append(target: Node, node: Node) { } export function insert(target: Node, node: Node, anchor?: Node) { - target.insertBefore(node, anchor || null); + if (target != document) { + target.insertBefore(node, anchor || null); + } } export function detach(node: Node) {