Skip to content

Svelte 5: #each index used as key causes error #9408

@brunnerh

Description

@brunnerh

Describe the bug

Presumably because the key function only gets passed the item.
Works in v4 so probably shouldn't cause errors in v5, even if it doesn't really do anything.

(Found by Thiagolino8 on Discord.)

Reproduction

{#each [1] as item, i (i)}
	{item}
{/each}

REPL

Logs

No response

System Info

REPL

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions