diff --git a/packages/resolvers/valibot/src/valibot.ts b/packages/resolvers/valibot/src/valibot.ts index 3ea7496..7103fe4 100644 --- a/packages/resolvers/valibot/src/valibot.ts +++ b/packages/resolvers/valibot/src/valibot.ts @@ -1,5 +1,5 @@ import { toNestError } from '@vorms/resolvers'; -import { parse } from 'valibot'; +import { parseAsync } from 'valibot'; import type { Resolver } from './types'; import type { Issues } from 'valibot'; @@ -26,7 +26,7 @@ const parseErrorSchema = (valibotIssues: Issues) => { export const valibotResolver: Resolver = (schema) => async (values) => { try { - parse(schema, values); + await parseAsync(schema, values); return {}; } catch (error: any) { if (error.name !== 'ValiError') throw error; diff --git a/packages/resolvers/zod/src/zod.ts b/packages/resolvers/zod/src/zod.ts index 51d6b8f..fe4a912 100644 --- a/packages/resolvers/zod/src/zod.ts +++ b/packages/resolvers/zod/src/zod.ts @@ -28,7 +28,7 @@ const parseErrorSchema = (zodErrors: z.ZodIssue[]) => { export const zodResolver: Resolver = (schema) => async (values) => { try { - await schema.parse(values); + await schema.parseAsync(values); return {}; } catch (error: any) {