You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constprofileFormSchema=z.object({username: z.string().min(3,{message: 'Username must be at least 3 characters.',}).max(20,{message: 'Username must not be longer than 20 characters.',}),email: z.string({required_error: 'Please select an email to display.',}).email(),bio: z.string().max(160).min(4),urls: z.array(z.object({value: z.string().url({message: 'Please enter a valid URL.'}),})).optional(),})typeProfileFormValues=z.infer<typeofprofileFormSchema>constform=useForm<ProfileFormValues>({resolver: zodResolver(profileFormSchema),
defaultValues,mode: 'onChange',})
Argument of type 'ZodObject<{ username: ZodString; email: ZodString; bio: ZodString; urls: ZodOptional<ZodArray<ZodObject<{ value: ZodString; }, "strip", ZodTypeAny, { value: string; }, { ...; }>, "many">>; }, "strip", ZodTypeAny, { ...; }, { ...; }>' is not assignable to parameter of type 'ZodType<any, any, any>'.
The types of 'refine(...)._def.typeName' are incompatible between these types.
Type 'import("E:/anu/Web Development/Git Clone/UIVerse/node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/types").ZodFirstPartyTypeKind.ZodEffects' is not assignable to type 'Zod.ZodFirstPartyTypeKind.ZodEffects'.
Property 'ZodReadonly' is missing in type 'Zod.ZodFirstPartyTypeKind'.ts(2345)
const profileFormSchema: z.ZodObject<{
username: z.ZodString;
email: z.ZodString;
bio: z.ZodString;
urls: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
}, {
value: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
...;
}, {
...;
}>
I went to their respective repositories, but was unable to find solution for my problem. I want to use zod for validation but I've no clue on how to fix this typescript error.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
The error is caused by:
The text was updated successfully, but these errors were encountered: