-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Bug: Stores Does Not Automatically Update #536
Comments
I've got other reports for this, so will take a look at it now |
Something breaks in the latest version of SvelteKit. Workaround: If you use |
Seems to be some problem with applyAction, it does not trigger a page update after the first request. |
This line doesn't trigger the page update anymore, which in turn prevents the update code to run. |
Possibly related to https://svelte.dev/docs/kit/$app-state |
Reported on SvelteKit here: sveltejs/kit#13200 |
Thanks for the quick response man! |
Thanks for logging this! Could forms not being reset also be related to this? I was going to log an issue but I'm not wondering if this is related. Basically |
Is this bug need Svelte team to be updated ? |
Yes, we're waiting for a sveltekit PR to be merged. In the meantime, you can use this: |
The PR progress can be tracked here: sveltejs/kit#13205 |
Description
The error store does not automatically update when an error changes.
A form can only be submitted if all fields are error-free. However, in this library, the error state does not update to reflect new errors if we trigger a new one immediately.
Only happens when use:enhance is turned on
Steps to Reproduce
Expected Behavior
The error store should update automatically to reflect the new errors.
Actual Behavior
The new error is not reflected in the UI, leading to inconsistencies.
This produces some weird side effects, like not reacting to errors when submitting the form for a second time
Workaround
A hacky workaround involves manually updating the error store using the
onUpdate
option:If applicable, a MRE
Use this template project to create a minimal reproducible example that you can link to here: link to open in a new tab)
The text was updated successfully, but these errors were encountered: