-
-
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
state_unsafe_mutation when an error happened inside the ":then" block #14186
Comments
What is the |
I think that's intentional - the report is that Svelte doesn't recover well from runtime errors like this. Which I don't think there's a lot that can be done about until we implement error boundaries, correct? |
It's just to simulate an error. I can change it to: <script>
let { need } = $$props;
let promise = fetch('https://jsonplaceholder.typicode.com/todos/1');
</script>
{#await promise}
{:then value}
{value.obj.value}
{:catch error}
{error}
{/await} same result. It breaks all components on the website, which isn't ideal for production. |
@trueadm the problem is that after the first error that happens during rendering of the then block every change is throwing This is because of point number 1 here:
|
Ohhh this is because bind:value it's adding an event listener normally so it's not deferred. |
Nice find! |
Should we change |
it just needs to use |
Yeah exactly |
@paoloricciuti Are you doing that now or should we create an issue for it? |
I can do it probably In a bit |
I've already got a PR incoming :) |
Describe the bug
It seems like Svelte gets stuck in an effect state.
Reproduction
https://svelte.dev/playground/6fbbf69c47894154bfa37c9fb83e7ac0?version=5.1.11
Type something in the text input
Logs
No response
System Info
System: OS: Linux 5.15 Manjaro Linux CPU: (12) x64 AMD Ryzen 5 5600G with Radeon Graphics Memory: 10.44 GB / 30.70 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 22.6.0 - /usr/bin/node npm: 10.8.2 - /usr/bin/npm bun: 1.1.24 - /usr/bin/bun Browsers: Brave Browser: 128.1.69.160 npmPackages: svelte: ^5.1.11 => 5.1.11
Severity
annoyance
The text was updated successfully, but these errors were encountered: