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/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/drizzle-orm/utils.js:108:15)
at Module.c (redacted/node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected][email protected][email protected]_/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/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/drizzle-orm/utils.js:108:15)
at Module.c (redacted/node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected][email protected][email protected]_/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:56231:9)
2 Replies
steetyj
steetyj6mo 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
iolydOP6mo 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