-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Wrong order of execution for reactive variable #4371
Comments
$: console.log("gold", gold); will do what you want. |
Thanks. I figured as much. I still think that the current behaviour is unexpected and probably a bug. |
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 |
This no longer breaks in the most recent version and instead prints |
|
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: