Svelte

#each key with array blows up

#17721

Development PRs

Issue

Solved
K
KieranP
Feb 17, 2026, 3:55 AM

Describe the bug

The key can be any object

So I tried using array as a key for #each block:

{#each things as thing ([thing.group, thing.id])}

Works fine when page loads, but when data changes, it throws error.

Had to convert to string in order to get it working:

{#each things as thing ([thing.group, thing.id].join('-')}

So either docs need updating, or #each needs fixing to support array keys

Reproduction

https://svelte.dev/playground/1db5362a3e974b209b11ae389758c93f?version=5.51.2

Click button, check browser console.

Logs

playground:output:5619 Uncaught TypeError: Cannot read properties of undefined (reading 'e')
    at reconcile (playground:output:5619:54)
    at commit (playground:output:5450:4)
    at Batch.process (playground:output:1109:46)
    at flush_effects (playground:output:1484:11)
    at Batch.flush (playground:output:1244:5)
    at Array.eval (playground:output:1417:13)
    at run_all (playground:output:126:10)
    at run_micro_tasks (playground:output:739:3)
    at eval (playground:output:757:32)

System Info

System:
    OS: macOS 26.3
    CPU: (14) arm64 Apple M4 Pro
    Memory: 439.02 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.10.0 - /Users/kieran/.local/share/mise/installs/node/24.10.0/bin/node
    npm: 11.6.1 - /Users/kieran/.local/share/mise/installs/node/24.10.0/bin/npm
    pnpm: 10.29.3 - /Users/kieran/.local/share/mise/installs/node/24.10.0/bin/pnpm
  npmPackages:
    svelte: 5.51.0 => 5.51.0

Severity

annoyance

Info

Closed at Feb 17, 2026, 9:38 PM
Assignees None
Labels None
Milestone None

Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)