diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts index e706928af305..626a8e9e6518 100644 --- a/src/runtime/internal/Component.ts +++ b/src/runtime/internal/Component.ts @@ -130,7 +130,7 @@ export function init(component, options, instance, create_fragment, not_equal, p callbacks: blank_object(), dirty, skip_bound: false, - root: options.target || parent_component.$$.root + root: options.target || (parent_component ? parent_component.$$.root : document) }; append_styles && append_styles($$.root);