-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
outtroBlock issue causes dynamic components with each block to not be destroyed #1660
Comments
I attempted to reproduce the issue. However, there is another error that occurs when you click 'Child2'
https://svelte.technology/repl?version=2.11.0&gist=1942fddd9ef996aa566059a90b07df29 From my app, it seems like the issue has to do with the following:
If the each block in the grandchild component does not load a component, then the issue does not manifest. |
The order of method invocation is as follows: for (; #i < ${iterations}.length; #i += 1) ${outroBlock}(#i, 1); svelte/src/compile/nodes/EachBlock.ts Line 454 in 26dfb9a
then for (let #i = 0; #i < ${iterations}.length; #i += 1) ${outroBlock}(#i, 0, ${countdown});` svelte/src/compile/nodes/EachBlock.ts Line 484 in 26dfb9a
Notice that the first time outroBlock is invoked, there is no |
In the short term, setting
causes |
fix(@ctx-core/svelte): Fix component not being destroyed due to svelte bug sveltejs/svelte#1660
Allow non-existent dynamic components to be destroyed
There was never a repro for this — is it still an issue, or was it fixed? |
I'm going to assume this has been fixed, at least by the recent outro/detach stuff. Please reopen if you have a repro. |
My app seems to be running into this edge case. I don't yet have an isolated reproduction of the issue, but I do have some generated output that has the bug with the fix.
This causes the issue. The problem is
each_blocks[i]
is set to null & outroBlock is called two times. The first invocation does not have thefn
argument and the second invocation does (however,each_blocks[i]
isnull
).This seems to work:
The text was updated successfully, but these errors were encountered: