-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Compile error: Nested loops with index broke after 3.9.1 #3588
Comments
@Xerios, the code from the REPL builds and works under 3.12.1 when building for production via |
Turns out my issue was some sort of race condition. After diving into the generated code I noticed this: function create_each_block$5(ctx) {
// ctx.data has 0 elements, thus if_block is not created
var if_block = ctx.data[ctx.paneIndex] && create_if_block_1$4(ctx);
// ...
const block = {
p: function update(changed, new_ctx) {
// ctx.data has one element, but since if_block wasn't created, it gives an error
if (ctx.data[ctx.paneIndex]) if_block.p(changed, ctx);
}
}
} |
This bug is still present with the changes in the |
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: