Skip to content

RangeError: Invalid array length triggered from each block internal code #17368

@MathiasWP

Description

@MathiasWP

Describe the bug

We got this alert in sentry: https://kvist.sentry.io/share/issue/91b8d23b14b346ed8eec91684d4c01fd/

I'm not sure how this happened, but i'm pretty sure we don't render an each block with more than (2^32)-1 OR negative amount of items.

Any help here is appreciated!

Reproduction

I'm not sure how this is reproduced. Will update the issue if we find anything more.

The code that triggered this error:

// node_modules/.pnpm/[email protected]/node_modules/svelte/src/internal/client/dom/blocks/each.js 
while (current !== null) {
	// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished
	if ((current.f & INERT) === 0 && current !== state.fallback) {
		to_destroy.push(current);
	}
	current = current.next;
}

Logs

System Info

System:
    OS: macOS 26.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 98.09 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - /Users/mathiaspicker/.nvm/versions/node/v22.14.0/bin/node
    npm: 10.9.2 - /Users/mathiaspicker/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 10.22.0 - /opt/homebrew/bin/pnpm
    bun: 1.0.0 - /Users/mathiaspicker/.bun/bin/bun
  Browsers:
    Brave Browser: 142.1.84.141
    Chrome: 143.0.7499.42
    Edge: 143.0.3650.80
    Firefox: 142.0.1
    Safari: 26.1
  npmPackages:
    svelte: 5.45.6 => 5.45.6

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions