Skip to content

#each blocks without an item + key expression cause a runtime error #16927

@x0k

Description

@x0k

Describe the bug

When using an #each block like this: {#each { length: data.length }, index (data[index])}, the generated JavaScript is invalid — (, index) => data[index], which results in a runtime error.

Expected: this syntax should either be supported or produce a compile-time error.

Workaround: {#each { length: data.length } as _, index (data[index])}

Reproduction

REPL

Logs

System Info

-

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions