-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
In some cases, the reactive is not working properly.
I have provided a link to the reproduced code for the svelte5 REPL, please check it out.
This problem has been happening since 5.28.2 and does not seem to occur in 5.28.1 or earlier.
This may be similar to #15853.
Reproduction
https://svelte.dev/playground/4b1cfa51635243a193a7f76ad7696b17?version=5.30.1
Steps to reproduce the issue:
- enter text in inputValue1 of store#0.
- enter text in inputValue2 of store#0.
- outputValue of store #0 is changes.
- Press ADD STORE to add store#1.
- enter text in inputValue1 of store#1.
- enter text in inputValue2 of store#1.
- outputValue of store#1 does not change. Is the reactive broken?
The problem does not seem to occur in 5.28.1.
https://svelte.dev/playground/4b1cfa51635243a193a7f76ad7696b17?version=5.28.1
Logs
System Info
System:
OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400 @ 2.60GHz
Memory: 6.78 GB / 15.42 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 22.12.0 - /usr/local/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 10.9.0 - /usr/local/bin/npm
pnpm: 10.10.0 - /usr/local/bin/pnpm
npmPackages:
svelte: ^5.28.2 => 5.28.2Severity
blocking an upgrade
Activity
[-]Strange reactive behavior[/-][+]Strange reactive behavior (5.28.2 or later)[/+]endigo9740 commentedon May 16, 2025
Hey folks, Chris here from Skeleton. We're seeing similar behavior as well.
See this thread:
skeletonlabs/skeleton#3543 (comment)
To provide some context:
5.30.1)5.28.6appears to resolve the issueLet me be clear that I don't believe Zag to be at fault here - it's just a means to see the issue in play. We shouldn't expect breaking changes from a minor point release of Svelte like this, so something is amiss.
paoloricciuti commentedon May 17, 2025
It's obviously not a breaking change, it's just a bug.
However it feels weird because the releases you are referencing didn't touch anything in the reactivity part from what I can see (also those are different versions)...will check later what is going on
gyzerok commentedon May 17, 2025
Our app also got broken after recent update. The reason in our case was that apparently sync flushing changed runtime order of execution.
The following code previously would work:
Not sure if that's related, but wanted to share in case it'll help the investigation.
paoloricciuti commentedon May 17, 2025
What would that code do? It seems broken at the JS level
paoloricciuti commentedon May 17, 2025
Btw I'm pretty sure this is a duplicate of this
#15829
Let's keep it open for the moment but I'll keep an eye on it
gyzerok commentedon May 17, 2025
Would need to copy to much internal details to give a good idea. And I agree, the order of initialization is incorrect on our side anyway. However before some things were happening in microtasks which are now synchronous and that's why it wasn't a problem for several months, but is a problem now.
paoloricciuti commentedon May 17, 2025
It feels weird anyway, if you can provide a reproduction we can take a look
gyzerok commentedon May 18, 2025
I'll see if I can make it, there is also lexical involved in this code
endigo9740 commentedon May 30, 2025
Quick follow up - I ran the same test today for our Tabs component with Svelte version
5.33.10and the original issue seems to be resolved. I can't vouch for everyone else, but may be worth testing again on your end.MrVauxs commentedon Jun 1, 2025
Updating to both 5.33.11 and 5.33.10, I can still replicate this issue with Skeleton components.
endigo9740 commentedon Jun 1, 2025
@MrVauxs we had something similar reported on Discord
When I tested this was in a fresh new project, so I might recommend testing that and copying the tabs directly from the Skeleton docs to replicate. That was working.
So perhaps updating the
sveltedependency is not enough? Perhaps is an intersection of a couple dependencies?MrVauxs commentedon Jun 1, 2025
I can replicate the issue not happening on a fresh install, but I still cannot find a solution for existing projects. I unfortunately cannot downgrade to 28 due to bits-ui dependency.
However, I have found an interesting quirk to the specific Skeleton Tabs example. It also updates when you change focus, or generally click anywhere else.
chrome_huW48m5zvN.mp4
endigo9740 commentedon Jun 4, 2025
@MrVauxs if you believe that to be a bug on the Skeleton end, file a bug on our side. Let's not trouble the Svelte folks with unrelated issues.
3 remaining items