Skip to content

@vee-validate/valibot 4.13.1 (latest) not compatible with valibot 0.33.0 #4788

@cmcnicholas

Description

@cmcnicholas

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

  1. install latest valibot
  2. install latest vee-validate and vee-validate/valibot
  3. use the toTypedSchema method
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions