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
I've managed to fix the parse error but can't add nullish because of weird type errors. Also noticed that nullable and optional no longer retain the class and will break your types. Perhaps a typescript compiler change has broken that.
I wouldn't recommend using this library because zod wasn't designed to be extended this way. Perhaps it'll be fixed in a later zod version.
My classes
const productInventoryLocation = ProductInventoryLocationClass.parse(response)
Crash only when product field with .nullish() or .optional() or .nullable()
v0.0.14
TypeError: Cannot read properties of undefined (reading '_parse')
❯ ZodOptional._parse node_modules/zod/lib/index.mjs:3765:36
❯ ZodNullable._parse node_modules/zod/lib/index.mjs:3784:36
❯ ZodObject._parse node_modules/zod/lib/index.mjs:2379:37
❯ ZodObject._parseSync node_modules/zod/lib/index.mjs:678:29
❯ ZodObject.safeParse node_modules/zod/lib/index.mjs:708:29
❯ ZodObject.parse node_modules/zod/lib/index.mjs:689:29
❯ Function.parse node_modules/zod-class/src/index.ts:306:38
The text was updated successfully, but these errors were encountered: