diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts index 3e4801054757..b4e31d841f0c 100644 --- a/src/runtime/internal/Component.ts +++ b/src/runtime/internal/Component.ts @@ -124,7 +124,7 @@ export function init(component, options, instance, create_fragment, not_equal, p on_disconnect: [], before_update: [], after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), + context: new Map(options.context || (parent_component && parent_component.$$ ? parent_component.$$.context : [])), // everything else callbacks: blank_object(),