Skip to content

Svelte 5: #each block behaving differently with pnpm dev vs pnpm build #10473

@svelte-kit-so-good

Description

@svelte-kit-so-good

Describe the bug

In the +layout.svelte of the repro there are 4 variants.

  • Version 1 insidiously breaks on deployment (as discussed in this closed issue 10437).
  • Version 2 is the now prescribed way (?) ... which is unnecessary when using writable stores
  • Version 3 actually breaks on pnpm dev 🤷‍♀️
  • Version 4 just works; I've moved all the logic to a component and imported it.

Note: the repro starts with Version 3. If you run pnpm build && pnpm preview the demo works (works means the modal loads properly when clicking the options in the '/iframes' route). If you run pnpm dev the demo breaks.

Reproduction

SvelteLab demo

Logs

No response

System Info

Svelte v5.0.0-next.53; but tried as far back as alpha 20.

Severity

annoyance

Metadata

Metadata

Assignees

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