Skip to content

TypeBox resolver does not work with valid TypeBox schema #709

@divmgl

Description

@divmgl

Describe the bug
I'm getting this error:

Argument of type 'TObject<{ name: TString; score: TString; externalId: any; }>' is not assignable to parameter of type 'TObject<TProperties> | TypeCheck<TObject<TProperties>>'.ts(2345) Argument of type 'TObject<{ name: TString; score: TString; externalId: any; }>' is not assignable to parameter of type 'TObject<TProperties> | TypeCheck<TObject<TProperties>>'. Type 'TObject<{ name: TString; score: TString; externalId: any; }>' is missing the following properties from type 'TypeCheck<TObject<TProperties>>': schema, references, checkFunc, code, and 3 more.ts(2345) 

Here is the TypeBox schema:

export const UPDATE_APPLICATION_INPUT_SCHEMA = Type.Object({ name: Type.String({ minLength: 1 }), score: Type.String(), externalId: Type.String().Nullable(), })
 const form = useForm<UpdateApplicationInput>({ resolver: typeboxResolver(UPDATE_APPLICATION_INPUT_SCHEMA), defaultValues: { name: application.name, externalId: application.externalId ?? null, }, })

Why is this happening?

Expected behavior
No error occurs.

Additional context
TypeBox version: 0.32.35
@hookform/resolvers: 3.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions