We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 974f908 commit 4ccc64dCopy full SHA for 4ccc64d
headless/src/forms/resolvers/valibot/index.ts
@@ -1,4 +1,3 @@
1
-import { safeParseAsync } from 'valibot';
2
import type { BaseIssue, BaseSchema, BaseSchemaAsync, InferOutput } from 'valibot';
3
import { toNestError } from '../../core/shared';
4
import type { FormErrors } from '../../core/types';
@@ -10,6 +9,8 @@ export type ValibotResolver = <
10
9
) => (values: InferOutput<T>) => Promise<FormErrors<InferOutput<T>>>;
11
12
export const valibotResolver: ValibotResolver = schema => async values => {
+ const { safeParseAsync } = await import('valibot');
13
+
14
try {
15
const result = await safeParseAsync(schema, values);
16
if (!result.success) {
0 commit comments