Skip to content

Compile error: Nested loops with index broke after 3.9.1 #3588

@Xerios

Description

@Xerios

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:
image
(paneIndex is the index from {#each ... } loop)

To Reproduce
https://svelte.dev/repl/af7ece0c29f240ad97bf795bd3be1347?version=3.9.1

  • Remove debug, it compiles properly
  • Remove the inner loop, and it compiles properly.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions