-
Notifications
You must be signed in to change notification settings - Fork 30
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Keep errors while submiting to the server #121
Comments
Am I using it ok? Is there a way of avoiding this glitch? |
Also, to keep previous data, I had to use I say this because otherwise, all inputs are empty when one of them have a validation error no? |
Hi, thanks for bringing this up! I understand the issue. Going to compare with other libraries and report back shortly with next steps. In the meantime -- if you want to try -- you should be able to get this persistence with useActionState. This also supports progressive enhancement.
Do you mean to return |
Yes! |
What version of React is this? |
Also if you are using npm link, do you want to give the input schema functions a shot? Going to merge soon would be awesome if you can test that branch in your project and give feedback. |
I'm living on the edge xD {
"next": "14.3.0-canary.59",
"next-auth": "5.0.0-beta.19",
"react": "19.0.0-beta-26f2496093-20240514",
"react-dom": "19.0.0-beta-26f2496093-20240514"
} Maybe is because of types? "@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19", |
I can try that. But would be ideal to use And out of the box get:
But I think that would be ideal without needing to customize errors or other parts of the lib. It would make a straightforward understand of the model |
Ah yes, I meant outside of this issue and related to #120 so you don't need to do validate unique username in the handler. |
Ah!! yes yes I didn't understand you. Let me check that |
Hi, the formatted errors come from Zod formatted errors. Same thing with field errors, and form errors. These are standard Zod error schemas that people use. We can be more clear in our docs to explain this. |
It does indeed. And also in your PR. All was my fault #121 (comment) |
Playing with this #120 is failing for me Basically I'm not sure what I have to pass in the input(async ({ ctx }) => z.object(...), { type: 'formData'}) ![]() I see this in Chrome Dev tools I think that PR could have a regression The same code in my app gets the error on But with that PR I get the error about my |
Maybe is related colinhacks/zod#2241 or this one colinhacks/zod#2746 |
Sorry for late response, was traveling this wknd!
Ah this is super tricky! I was so confused why the instance of wasn't getting the ZodObject in your first message. Good job debugging this.
Awesome! Happy to hear! Still writing some more tests. Excited to merge it.
Sometimes if there are rate limits in effect it could be useful to retry. This is also available in libraries such as Okay, I am going to move this conversation to #124 as the code is there. |
Yep, these are frontend concerns and because zsa already integrates with react-query there's no need to bring that complexity to this code.
Nice, happy to change anything |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What?
Hi, I'm using
useServerAction
to save some data into my server. It's working fine but I see a glitch whileisPending
The errors in the server are reset and the UI jumbs.
This is my form:
This is my action:
This is my UI. Check the disappearing red errors when submitting
Screen.Recording.2024-06-15.at.16.09.36.mov
The text was updated successfully, but these errors were encountered: