You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm undecided about what to do here. One option would be to just put the auto declarations from reactive variables earlier, but that might not be too helpful, as I think the non-reactive references to them would just get undefined. Perhaps it should be a compiler error to refer to an auto declared reactive variable from the top level of the <script>? Are there other situations we need to worry about? What happens when someone synchronously calls a function from the top level, and that refers to an auto declared variable?
$: blocks are executed at the end of initialization, but it isn't obvious. Svelte 5 will fix this through the runes API. In runes mode, it's a function through which it's more obvious that they don't fire immediately / you don't expect them to be executed immediately.
When I assign a value from a standard variable to a reactive variable, accessing the reactive variable afterwards results in an "uninitialized error".
For example:
Generates:
Which results in a
Cannot access 'gold' before initialization
error. I would expect it to generate:See Svelte REPL repro
The text was updated successfully, but these errors were encountered: