We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa3e98e commit 3e1f82bCopy full SHA for 3e1f82b
.changeset/olive-apples-lick.md
@@ -0,0 +1,5 @@
1
+---
2
+'svelte': patch
3
4
+
5
+fix: check if svelte component exists on custom element destroy
packages/svelte/src/internal/client/dom/elements/custom-element.js
@@ -193,7 +193,7 @@ if (typeof HTMLElement === 'function') {
193
this.$$cn = false;
194
// In a microtask, because this could be a move within the DOM
195
Promise.resolve().then(() => {
196
- if (!this.$$cn) {
+ if (!this.$$cn && this.$$c) {
197
this.$$c.$destroy();
198
destroy_effect(this.$$me);
199
this.$$c = undefined;
0 commit comments