react-hook-form / resolvers

📋 Validation resolvers: Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts and VineJS
https://react-hook-form.com/
MIT License
1.71k stars 155 forks source link

Valibot - custom not found - getPipeIssues getOutput #644

Closed VigilioYonatan closed 8 months ago

VigilioYonatan commented 9 months ago

Describe the bug Not recognize error when i use getPipeIssues

export const authRegisterDto = merge(
    [
        pick(usersSchema, ["username", "name", "email", "password"]),
        object({
            repeat_password: string([minLength(1, "this field is required")]),
        }),
    ],
    [
        (input) => {
         console.log(input) // if recognize input name.email,etc values when i type input  in form

         // Not found this validation: https://valibot.dev/guides/pipelines/
            if (input.repeat_password !== input.password) {
                return getPipeIssues("repeat_password", "not matches", input);
            }
            return getOutput(input);
        },
    ]
);

Dependencies "@hookform/resolvers": "^3.3.2", "react-hook-form": "^7.48.2", "valibot": "^0.20.1",

if any found the solution. i would like know it. thanks

jorisre commented 8 months ago

Can you provide a Codesandbox with the issue? thank you