-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Svelte 5.1.13: Reassigning store leads to undefined
#14233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Uh it probably needs more check before treating it as state (right now is treating style as state which is wrong |
The discrepancy is that the initializer does not treat it as state but the reassignment is |
But it shouldn't be treated as state at all in this case |
In my case, working around the problem should be easy and the codebase has already been upgraded to Svelte 5, so it’s actually not blocking upgrade but a breaking change 😅 |
I mean it's a bug not really a breaking change. Will fix asap 😁 |
@dummdidumm I've yet to be able to be at the keyboard but I have the reasonable suspect that we just need to add a check for runes mode. Because basically in rune mode you would never set the kind to state unless it has a |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Svelte 5.1.13, probably #14195, introduced a regression in the store API, breaking my Sveltia UI library and Sveltia CMS. I had to downgrade to 5.1.12 to get rid of the error.
After creating a store with
writable
and reassigning a new store to the variable, the store changes toundefined
.My code
Reproduction
REPL: Svelte 5.1.12 / Svelte 5.1.13
In Svelte 5.1.13, the console says world if you uncomment
style = writable('svelte');
An interesting thing is the problem can be reproduced even before the
init
function is called. You’ll notice that the REPL doesn’t call the function.Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: