-
-
Notifications
You must be signed in to change notification settings - Fork 503
Open
Description
Describe the bug
Form-level validation with onChange and arrays throws an undefined errorMap when all fields are deleted or when a single field is removed. This issue only occurs with form-level validation using the onChange validator.
Uncaught TypeError: Cannot read properties of undefined (reading 'errorMap')
at @tanstack_react-form.js?v=473e5c45:1136:27
at functionalUpdate (@tanstack_react-form.js?v=473e5c45:423:42)
at @tanstack_react-form.js?v=473e5c45:1349:22
at Store.setState (@tanstack_react-form.js?v=473e5c45:296:22)
at FormApi.setFieldMeta (@tanstack_react-form.js?v=473e5c45:1344:22)
at @tanstack_react-form.js?v=473e5c45:1133:20
at batch (@tanstack_react-form.js?v=473e5c45:255:5)
at FormApi.validateSync (@tanstack_react-form.js?v=473e5c45:1090:7)
at FieldApi.validate (@tanstack_react-form.js?v=473e5c45:2205:97)
at FormApi.validateField (@tanstack_react-form.js?v=473e5c45:1080:28)
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-egzzxehs?file=src%2FApp.tsx
Steps to reproduce
- Make a change in the form to trigger onChange event (you must see validation error for both fields)

- Click on
clear all
orclean one
- See console logs
TanStack Form version
1.19.2
TypeScript version
5.8.3
Metadata
Metadata
Assignees
Labels
No labels