Skip to content

A derived value sometimes loses its reactivity #14896

Closed
@hironytic

Description

@hironytic

Describe the bug

After upgrading to 5.16.1, I noticed that a derived value sometimes loses its reactivity in my project.
I couldn’t find the exact trigger though, I could find reproduction steps in a minimal code in the playground.

Reproduction steps:

  1. Click “d” button, then current id changes to 4, and name to d.
  2. Click “Show / Hide” button, then the content above is hidden.
  3. Click “Show / Hide” button again, then the content is back.
  4. Click “c” button, then current id changes to 3, and name to c.
  5. Click “b” button, then,
    • Expected behavior: current id changes to 2, and name to b.
    • Actual behavior: current id changes to 2, but name doesn’t change.

Reproduction

https://svelte.dev/playground/c10266b02aab40e58b93a9545c8ac639?version=5.16.1 (Reproducible)

https://svelte.dev/playground/c10266b02aab40e58b93a9545c8ac639?version=5.16.0 (Work as expected)

Logs

No response

System Info

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M2
    Memory: 133.42 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.volta/tools/image/node/20.15.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 10.7.0 - ~/.volta/tools/image/npm/10.7.0/bin/npm
    pnpm: 9.6.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.2
  npmPackages:
    svelte: ^5.16.1 => 5.16.1

Severity

blocking an upgrade

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