-
-
Notifications
You must be signed in to change notification settings - Fork 594
Open
Description
Describe the bug
If fieldMeta doesn't exist when an async validator runs, it won't be created. (synchronous validators do cause the meta to get created).
If the meta already exists (because you have a form.Field for that field, or because you do something like setFieldValue('age', 2)), the error gets added to the fieldMeta without a problem.
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-vxfykhc5?file=src%2Findex.tsx,package.json
Steps to reproduce
- Submit the form without clicking anything else.
form.errorsshows errors at the form level, but "Age Meta" remains empty - Change
onSubmitAsynctoonSubmit, then submit the form. The meta gets created as expected.
Expected behavior
If errors happen when doing an async validation, the field meta should be created if necessary.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS
Safari
TanStack Form adapter
react-form
TanStack Form version
1.28.0
TypeScript version
No response
Additional context
Possibly related to #1460
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels