refine parameters in createInsertSchema not typed properly

Hi I'm trying to get started with the Drizzle-Zod packages. I've just created a new repo using the hono create script (as per the CJ video on Syntax) installed drizzle and zod dpendencies and copied in the example createSelectSchema from the drizzle-zod docs page. The refine parameters adding min/max to the name and bio fields are giving typescript errors saying they do not exist on ZodType<Buffer, ZodTypeDef, Buffer> when the name and bio fields should be z.string types. What am I doing wrong? here are my dependencies: "dependencies": { "drizzle-orm": "^0.39.3", "drizzle-zod": "^0.7.0", "hono": "^4.7.2", "zod": "^3.24.2" }, "devDependencies": { "@cloudflare/workers-types": "^4.20250214.0", "@types/node": "^22.13.4", "drizzle-kit": "^0.30.4", "wrangler": "^3.101.0" }, "packageManager": "[email protected]+sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af"
No description
1 Reply
tobasaurus
tobasaurusOP3d ago
Problem was in tsconfig.json with "types": ["@cloudflare/workers-types/2023-07-01"], rathe than "types": ["node"],

Did you find this page helpful?