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
Debug is not at fault here, because in my project, the index is no longer passed onto nested loops which breaks my code.
Expected behavior
Proper compilation without errors
Stacktraces
No errors from the compiler, only compiled code gives an error
Information about your Svelte project:
Svelte version 3.9.1 compared to every single version above
Severity
Medium, project is live with over 100+ daily CCU. Having smooth animations is very important in my project. I would've loved to have latest transition/animations fixes which currently look a bit janky in 3.9.1, this compiler issue prevents me from upgrading.
The text was updated successfully, but these errors were encountered:
@Xerios, the code from the REPL builds and works under 3.12.1 when building for production via npm run build and npm run start so I think it really is debugging/dev codegen that is causing the issue. The if () is still the culprit, as you said, though.
Turns out my issue was some sort of race condition.
After diving into the generated code I noticed this:
functioncreate_each_block$5(ctx){// ctx.data has 0 elements, thus if_block is not createdvarif_block=ctx.data[ctx.paneIndex]&&create_if_block_1$4(ctx);// ...constblock={p: functionupdate(changed,new_ctx){// ctx.data has one element, but since if_block wasn't created, it gives an errorif(ctx.data[ctx.paneIndex])if_block.p(changed,ctx);}}}
Describe the bug
You can see the exact same weird parsing behavior in the example below
Logs

Generated code is wrong, for instance when using
{@debug paneIndex}
it generates this:(
paneIndex
is the index from{#each ... }
loop)To Reproduce
https://svelte.dev/repl/af7ece0c29f240ad97bf795bd3be1347?version=3.9.1
index
is no longer passed onto nested loops which breaks my code.Expected behavior
Stacktraces
Information about your Svelte project:
Severity
The text was updated successfully, but these errors were encountered: