© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
34 replies
MarvinKR

Issue with Drizzle-Zod: Due to a type mismatch between the ZodObject and ZodType types.

I have issues with this part of the code "due to a type mismatch between the ZodObject and ZodType types. The ZodObject type is missing a readonly property that is required by the ZodType type":

export type Media = z.infer<typeof updateMediaSchema>;
export type NewMedia = z.infer<typeof insertMediaSchema>;
export type NewMediaParams = z.infer<typeof insertMediaParams>;
export type UpdateMediaParams = z.infer<typeof updateMediaParams>;
export type MediaId = z.infer<typeof mediaIdSchema>["id"];

Type 'ZodObject<{ id: ZodNumber; imageUrl: ZodString; listingId: ZodString; updatedAt: ZodDate; createdAt: ZodDate; imageOrder: ZodNumber; }, UnknownKeysParam, ZodTypeAny, { ...; }, { ...; }>' does not satisfy the constraint 'ZodType<any, any, any>'.
Property 'readonly' is missing in type 'ZodObject<{ id: ZodNumber; imageUrl: ZodString; listingId: ZodString; updatedAt: ZodDate; createdAt: ZodDate; imageOrder: ZodNumber; }, UnknownKeysParam, ZodTypeAny, { ...; }, { ...; }>' but required in type 'ZodType<any, any, any>'. 'readonly' is declared here.
Screenshot_2023-09-16_at_14.30.41.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

drizzle-zod with custom types
Drizzle TeamDTDrizzle Team / help
3y ago
Issue with sqlite real type and drizzle-zod schema
Drizzle TeamDTDrizzle Team / help
4mo ago
Issue with drizzle-zod?
Drizzle TeamDTDrizzle Team / help
3y ago
Drizzle-zod createInsertSchema types
Drizzle TeamDTDrizzle Team / help
3y ago