Unexpected initial validation errors with validateOnMount:true and async initialValues in vee-validate v4
0 reputation · 01 Apr 2023, 17:14 UTC
Behavior discrepancy
vee-validate v4 changed the default validateOnMount value from false (v3) to true, but the documentation states only "validates on mount" without specifying the interaction with asynchronously loaded initialValues or pre-set initialErrors.
Observed constraint
When initialValues are populated after the form mounts — for example, from an API response — the validation run triggered by validateOnMount:true executes against empty or partial values, producing false-positive errors that persist until the next validation cycle.
Unresolved decision
It is unclear whether this behavior is intentional, whether validateOnMount should defer until after the first initialValues update, or whether users are expected to explicitly set validateOnMount:false and manually trigger validation once data arrives.
Does validateOnMount:true intentionally validate against unset initialValues? Should the first validation be deferred until initialValues are populated? Is there a recommended pattern for async initial data that avoids false-positive errors without disabling mount validation entirely?