Package version
4.4.0
Describe the bug
Describe the bug
VineJS's Standard Schema implementation sets issue.path to the dotted field string (e.g. "user.name"), but the Standard Schema spec requires path to be an array of segments.
From @standard-schema/spec: (
interface Issue {
readonly message: string;
/** The path of the issue, if any. */
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
}
Reproduction
import vine from '@vinejs/vine'
const schema = vine.create(vine.object({ user: vine.object({ name: vine.string() }) }))
const result = await schema['~standard'].validate({ user: {} })
console.log(result.issues[0].path) // "user.name" ❌
console.log(Array.isArray(result.issues[0].path)) // false
// Spec expects: ["user", "name"]
Root cause
src/vine/validator.ts, in the ~standard.validate implementation:
return {
issues: error?.messages.map((message: any) => {
return {
...message,
path: message.field, // 👈 message.field is a dotted string, not an array
}
}),
}
message.field is the dotted field path ("user.name"), assigned directly to path.
Impact
Because a JS string is array-like (has length and numeric indices), consumers that iterate path (e.g. TanStack Form, don't throw — they iterate the string character by character ("u", "s", "e", "r", …). The failure is silent: validation fails but errors are never attached to the right fields, so no messages show up. This makes VineJS unusable as a TanStack Form validator without a runtime monkey-patch.
Expected behavior
path should be an array of segments per the spec — e.g. ["user", "name"]
Reproduction repo
No response
Package version
4.4.0
Describe the bug
Describe the bug
VineJS's Standard Schema implementation sets
issue.pathto the dotted field string (e.g."user.name"), but the Standard Schema spec requirespathto be an array of segments.From
@standard-schema/spec: (Reproduction
Root cause
src/vine/validator.ts, in the~standard.validateimplementation:message.fieldis the dotted field path ("user.name"), assigned directly topath.Impact
Because a JS string is array-like (has
lengthand numeric indices), consumers that iteratepath(e.g. TanStack Form, don't throw — they iterate the string character by character ("u","s","e","r", …). The failure is silent: validation fails but errors are never attached to the right fields, so no messages show up. This makes VineJS unusable as a TanStack Form validator without a runtime monkey-patch.Expected behavior
pathshould be an array of segments per the spec — e.g.["user", "name"]Reproduction repo
No response