You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Via sveltejs/kit#2302: because DOM-less components do not have a fragment, they do not get properly destroyed when they're used with <svelte:component>:
I haven't yet investigated whether this would break other stuff, but adding the following fixes this specific bug:
export function transition_out(block: Fragment, local: 0 | 1, detach?: 0 | 1, callback?) {
if (block && block.o) {
if (outroing.has(block)) return;
outroing.add(block);
outros.c.push(() => {
outroing.delete(block);
if (callback) {
if (detach) block.d(1);
callback();
}
});
block.o(local);
+ } else if (callback) {+ callback();
}
}
Reproduction
Can't show it in the REPL because it only appears in prod mode (DOM-less components still have a fragment in dev mode, because that's where we put certain warnings):
@Rich-Harris After investigating it, I have found differences between dev and production environment.
In dev environment, the fragment property does have value, but in production environment, the fragment value is "false".
callback() on else branch is a workable alternative. Besides, fragment value on DOM-less components on both dev and production environment should behave the same. I will create a PR to fix this one.
Describe the bug
Via sveltejs/kit#2302: because DOM-less components do not have a
fragment
, they do not get properly destroyed when they're used with<svelte:component>
:The culprit is here:
svelte/src/runtime/internal/transitions.ts
Lines 68 to 83 in dbbac28
I haven't yet investigated whether this would break other stuff, but adding the following fixes this specific bug:
Reproduction
Can't show it in the REPL because it only appears in prod mode (DOM-less components still have a fragment in dev mode, because that's where we put certain warnings):
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: