Nextjs serverValidate doesn't return accurate typed-values
Hello, I followed this example to setup Nextjs backend validation https://tanstack.com/form/latest/docs/framework/react/examples/next-server-actions
I'm using zodv4 for validations.
The serverValidate has objectify-ed the array and stringify-ed the numbers as you can see in the screenshots. Have I missed something in the configuration ? Should I Object.values every array and parseFloat every number resulting of the validated data ?
By the way, love this library so far and I really enjoy using it, thank you for it, keep up the very good work!
React TanStack Form Next Server Actions Example | TanStack Form Docs
An example showing how to implement Next Server Actions in React using TanStack Form.



2 Replies
wise-white•3w ago
Can't recall off of the top of my head. Since it's
FormData being passed, this kind of stringification is expected, but I'm not sure where the intended way ends and accidental bugs begin. I'll try to check later this week if that's alrightrival-blackOP•3w ago
Yes no problem on my side, I'll do manual conversion in the meantime and check again later, thanks 😉