Drizzle-zod errors

What is supposed to be the highest version of drizzle-orm supported by drizzle-zod's latest release? I'm facing a breaking error when defining validation schemas using createInsertSchema with drizzle-orm@latest and it persists even when trying to regress all the way to @0.30.9, where I stopped trying older versions.
TypeError: Cannot read properties of undefined (reading 'Symbol(drizzle:Columns)')
at getTableColumns (redacted/node_modules/.pnpm/drizzle-orm@0.31.1_@neondatabase+serverless@0.9.3_@types+pg@8.11.6_postgres@3.4.4/node_modules/drizzle-orm/utils.js:108:15)
at Module.c (redacted/node_modules/.pnpm/drizzle-zod@0.5.1-7a4cc2d_drizzle-orm@0.31.1_@neondatabase+serverless@0.9.3_@types+pg@8.11.6_postgres@3.4.4__zod@3.23.8/node_modules/drizzle-zod/index.mjs:1:431)
at redacted/src/lib/crud/validation/auth.ts:29:28
at async instantiateModule (redacted/node_modules/.pnpm/vite@5.2.12_@types+node@20.14.2_lightningcss@1.25.1_sass@1.77.4_sugarss@4.0.1_postcss@8.4.38_/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:56231:9)
TypeError: Cannot read properties of undefined (reading 'Symbol(drizzle:Columns)')
at getTableColumns (redacted/node_modules/.pnpm/drizzle-orm@0.31.1_@neondatabase+serverless@0.9.3_@types+pg@8.11.6_postgres@3.4.4/node_modules/drizzle-orm/utils.js:108:15)
at Module.c (redacted/node_modules/.pnpm/drizzle-zod@0.5.1-7a4cc2d_drizzle-orm@0.31.1_@neondatabase+serverless@0.9.3_@types+pg@8.11.6_postgres@3.4.4__zod@3.23.8/node_modules/drizzle-zod/index.mjs:1:431)
at redacted/src/lib/crud/validation/auth.ts:29:28
at async instantiateModule (redacted/node_modules/.pnpm/vite@5.2.12_@types+node@20.14.2_lightningcss@1.25.1_sass@1.77.4_sugarss@4.0.1_postcss@8.4.38_/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:56231:9)
2 Replies
steetyj
steetyj3mo ago
Did you ever find a solution for this? I am stuck here as well I actually figured out my issue. I had circular import references in my schema file where I was importing some types. The file with the types was trying to import a table from the schema
iolyd
iolyd3mo ago
Yeah, I should've posted how I fixed it for posterity. It was also due to a circular reference on my side where I was importing and using a reference to a table column in a file that also exported constants used to define said table column. Honestly the logs were of 0 help here.
Want results from more Discord servers?
Add your server