Skip to content

Dev mode {#each} check breaks with strings #4450

@Conduitry

Description

@Conduitry

Describe the bug
The dev mode validation check for {#each} blocks breaks with strings.

Logs
cannot use 'in' operator to search for "length" in "foo"

To Reproduce
https://svelte.dev/repl/svg-transitions?version=3.19.0

Expected behavior
Same as https://svelte.dev/repl/svg-transitions?version=3.18.2

Stacktraces

Information about your Svelte project:

  • Browser independent
  • Reproducible in REPL

Severity
Moderate, probably.

Additional context
The check introduced in #4419 apparently throws with strings. We probably want to consider strings to be array-like objects, and so we need to be more permissive with the validation check.

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