Skip to content

svelte 5: stale reactive prop #10316

Closed
@izznat

Description

@izznat

Describe the bug

The prop is not updated even though it is changed and triggers rerender.

Reproduction

Please look at src/lib/components/Toolbar.svelte and src/routes/+page.svelte.
Reproduction

Other relevant files:

  • src/lib/use-machine.svelte.ts
  • src/lib/use-service.svelte.ts
  • src/lib/use-snapshot.svelte.ts

Steps:

  1. Open browser console
  2. Click the alpha channel input that has the value of 1
  3. Observe the inspection logs on the console
  4. Notice that machine.state log is correctly updated but state log is not but also has updated label

Expected behavior:
state prop is updated correctly. See console panel while toggling the state in this REPL.

Logs

It's too long to fit in here, but you can see at browser console that machine.state is changed while state is not via inspect rune in Toolbar.svelte.

System Info

System:
    OS: Linux 6.6 Pop!_OS 22.04 LTS
    CPU: (8) x64 AMD Ryzen 3 5300U with Radeon Graphics
    Memory: 2.65 GB / 9.56 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 21.6.1 - ~/.proto/shims/node
    Yarn: 1.22.21 - ~/.proto/shims/yarn
    npm: 10.4.0 - ~/.proto/shims/npm
    pnpm: 8.14.3 - ~/.proto/shims/pnpm
  npmPackages:
    svelte: ^5.0.0-next.1 => 5.0.0-next.40

Severity

annoyance

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