Skip to content
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

Valibot Adapter - Errors are concatenated to a single string #1127

Open
Pakue95 opened this issue Jan 24, 2025 · 0 comments
Open

Valibot Adapter - Errors are concatenated to a single string #1127

Pakue95 opened this issue Jan 24, 2025 · 0 comments

Comments

@Pakue95
Copy link

Pakue95 commented Jan 24, 2025

Describe the bug

When using the validbot adapter within a form.Field, a v.pipe schema will result in concatenation of the error messages in field.state.meta.errors.
E.g. instead of ["error1", "error2", "error3"] this is returned ["error1, error2, error3"]

Your minimal, reproducible example

https://codesandbox.io/p/devbox/ecstatic-northcutt-364clx?file=%2Fsrc%2Findex.tsx%3A48%2C15-52%2C17&workspaceId=ws_L7ruYMEE2bKZU53SwL4Ln4

Steps to reproduce

If the firstName field fails both checks the console.log prints an array with a single element instead of two.

Expected behavior

I'd expect every error to be a separate entry in the error object (as suggested by the type ValidationError[]).

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macOS 15.2
  • Browser: Chrome 132.0.6834.83

TanStack Form adapter

react-form

TanStack Form version

0.41.3

TypeScript version

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant