diff --git a/packages/svelte/src/runtime/internal/Component.js b/packages/svelte/src/runtime/internal/Component.js index 4512b3ab35f8..878251e08a38 100644 --- a/packages/svelte/src/runtime/internal/Component.js +++ b/packages/svelte/src/runtime/internal/Component.js @@ -287,7 +287,7 @@ if (typeof HTMLElement === 'function') { this.$$props_definition, 'toProp' ); - this.$$component.$set({ [attr]: this.$$data[attr] }); + this.$$component?.$set({ [attr]: this.$$data[attr] }); } disconnectedCallback() {