resolvers icon indicating copy to clipboard operation
resolvers copied to clipboard

type error

Open stephenomas opened this issue 1 year ago • 5 comments

i keep getting this error any time i try to build my nextjs app

Failed to compile.

./node_modules/@hookform/resolvers/yup/dist/yup.d.ts:3:138 Type error: '>' expected.

1 | import * as Yup from 'yup'; 2 | import { FieldValues, Resolver } from 'react-hook-form';

3 | export declare function yupResolver<TFieldValues extends FieldValues>(schema: Yup.ObjectSchema<TFieldValues> | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<TFieldValues>>>, schemaOptions?: Parameters<(typeof schema)['validate']>[1], resolverOptions?: { | ^ 4 | /** 5 | * @default async 6 | */

stephenomas avatar Oct 22 '23 16:10 stephenomas

Same here.

EvanAgee avatar Nov 03 '23 13:11 EvanAgee

Can you provide a Codesandbox with the issue? thank you

jorisre avatar Dec 13 '23 08:12 jorisre

Any updates or solutions? I have same issue.

Please let me know if you found a version w/o this bug

antonsolversio avatar Dec 20 '23 21:12 antonsolversio

I was seeing this error in my project, and it was because I had an older version of TypeScript. I was on TS 4.2.x

It looks like the "bad" TypeScript mentioned in this issue relies on a feature added in TypeScript 4.7: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#instantiation-expressions

After upgrading to TypeScript 4.7.4, the issue went away.

keithrz avatar Jan 15 '24 19:01 keithrz

@keithrz thank you so much

stefdomandtom avatar Jun 14 '24 21:06 stefdomandtom

It appears @keithrz's solution has resolved the issue. Closing this now.

jorisre avatar Jul 02 '24 21:07 jorisre