svelte: Derived value is not reactive when used in an `else if` branch.
Describe the bug
A derived value that is within a svelte.ts class is not reactive when used in an else if branch.
Reproduction
Logs
No response
System Info
I also tried this branch to no avail: https://github.com/sveltejs/svelte/pull/13153
System:
OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900K
Memory: 53.61 GB / 62.54 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 22.6.0 - ~/.nvm/versions/node/v22.6.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v22.6.0/bin/npm
pnpm: 9.1.4 - ~/.local/share/pnpm/pnpm
bun: 1.0.0 - /usr/local/bin/bun
Browsers:
Brave Browser: 110.1.48.171
Chrome: 128.0.6613.119
npmPackages:
svelte: https://gitpkg.now.sh/sveltejs/svelte/packages/svelte?fix-graph-inconsistency => 5.0.0-next.244
### Severity
blocking all usage of svelte
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (13 by maintainers)
Is it? I tried my examples on that PR’s deployment, but the bug remains.
Completely another example.
Correct, it’s a dev feature.
By the way, there’s a neat term for bug behavior like this: Heisenbug
Interestingly, adding an
$inspect('busy', job.isBusy);also fixes it. REPL