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
Is your feature request related to a problem? Please describe.
Currently the handling of server side errors is a big pain. Our situation is that we have server errors like these:
leterrors=[{path: "settings.stripe.testSignatureKey",messages: ["Wrong API key"],},];
and we want to automatically set form errors based on these server errors.
because the errors vanish as soon as someone modifies an input field.
I also tested other hacky solutions like this one with a recursive refine that checks for errors in the error store that match with a field of the zod schema:
But here we have a separate errorStore where we store all server errors after submit but like that we have race conditions because refine runs before the errors are set. and it generally feels really hacky.
we have to use client side validation because we are using GraphQL and we currently can't update the cache with the data of the server
Describe the solution you'd like
It would be really nice if we had a nice way to let superforms handle these things natively or provide a way to make the manually set errors not vanish on form modifications.
Describe alternatives you've considered
validationMethod: "submit-only" works but is turning off early validation for the whole schema
The text was updated successfully, but these errors were encountered:
I'd suggest making a derived/proxy store for this, based on $errors, but will store a list of errors that have been added manually, and replace them for those paths.
Is your feature request related to a problem? Please describe.
Currently the handling of server side errors is a big pain. Our situation is that we have server errors like these:
and we want to automatically set form errors based on these server errors.
We can't do this:
because the errors vanish as soon as someone modifies an input field.
I also tested other hacky solutions like this one with a recursive
refine
that checks for errors in the error store that match with a field of the zod schema:But here we have a separate errorStore where we store all server errors after submit but like that we have race conditions because
refine
runs before the errors are set. and it generally feels really hacky.Describe the solution you'd like
It would be really nice if we had a nice way to let superforms handle these things natively or provide a way to make the manually set errors not vanish on form modifications.
Describe alternatives you've considered
validationMethod: "submit-only"
works but is turning off early validation for the whole schemaThe text was updated successfully, but these errors were encountered: