We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0919128 commit 1bab571Copy full SHA for 1bab571
.changeset/many-trainers-pretend.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/runtime/internal/Component.js
@@ -335,7 +335,7 @@ if (typeof HTMLElement === 'function') {
335
this.$$cn = false;
336
// In a microtask, because this could be a move within the DOM
337
Promise.resolve().then(() => {
338
- if (!this.$$cn) {
+ if (!this.$$cn && this.$$c) {
339
this.$$c.$destroy();
340
this.$$c = undefined;
341
}
0 commit comments