-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
What happened?
The following code produces the resulting type error:
const validationSchema = toTypedSchema(
v.object({
email: v.pipe(
v.nonOptional(v.string(), 'Email is required'),
v.trim(),
v.email('Must be a valid email'),
),
}),
);
Argument of type 'ObjectSchema<{ readonly email: SchemaWithPipe<[NonOptionalSchema<StringSchema<undefined>, "Email is required">, TrimAction, EmailAction<string, "Must be a valid email">]>; }, undefined>' is not assignable to parameter of type 'BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>'.
Type 'ObjectSchema<{ readonly email: SchemaWithPipe<[NonOptionalSchema<StringSchema<undefined>, "Email is required">, TrimAction, EmailAction<string, "Must be a valid email">]>; }, undefined>' is not assignable to type 'BaseSchema<unknown, unknown, BaseIssue<unknown>>'.ts(2345)
Reproduction steps
- install latest valibot
- install latest vee-validate and vee-validate/valibot
- use the
toTypedSchema
method - see resulting type error
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
- Firefox
- Chrome
- Safari
- Microsoft Edge
Relevant log output
No response
Demo link
n/a
Code of Conduct
- I agree to follow this project's Code of Conduct
romansp, basitcodeenv, homersimpsons, charleme and akadmitry
Metadata
Metadata
Assignees
Labels
No labels