possible bug: standard schema introduction v3.24 breaks libraries that depend on core zod exposed types · Issue #4056 · colinhacks/zod · GitHub
More Web Proxy on the site http://driver.im/
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
The error message if you follow the exact example they mention today is:
Argument of type 'ZodObject<{ message: ZodString; }, "strip", ZodTypeAny, { message: string; }, { message: string; }>' is not assignable to parameter of type 'ZodType<any, ZodTypeDef, any>'.
Type 'ZodObject<{ message: ZodString; }, "strip", ZodTypeAny, { message: string; }, { message: string; }>' is missing the following properties from type 'ZodType<any, ZodTypeDef, any>': "~standard", "~validate"ts(2345)
Hi, long time zod user, love the work thank you all to who contribute.
Issue Brief
I think the introductiion of the
~standard
and~validate
props has broken how some libraries wrap zod functionality and extend itI was trying out the hono middleware mentioned by cloudflare's official docs: https://github.com/honojs/middleware/tree/main/packages/zod-validator
And it no longer works due to v3.24 i believe.
The error message if you follow the exact example they mention today is:
Internal Implementation of hono's zod validator can be seen here: https://github.com/honojs/middleware/blob/main/packages/zod-validator/src/index.ts
And the return type of the user's
const schema = z.object({ ... })
is no longer a matchPossible Solution
Two options to patch this come to mind:
Thanks again, I hope this is useful.
The text was updated successfully, but these errors were encountered: