Zod error after running introspect which leads to a ton of TS errors in generated schema.

Has anyone run into this error?:
% npm run drizzle:introspect

> [email protected] drizzle:introspect
> npx drizzle-kit introspect

drizzle-kit: v0.22.8
drizzle-orm: v0.31.2

No config path provided, using default path
Reading config file '/Users/hlab/Development/toro/TP4PT/toro/apps/revocruit-data/drizzle.config.ts'
Pulling from ['public', 'auth'] list of schemas

Using 'postgres' driver for database querying
[✓] 22 tables fetched
[✓] 233 columns fetched
[✓] 10 enums fetched
[✓] 9 indexes fetched
[✓] 32 foreign keys fetched

_ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"columns",
1,
"expression"
],
"message": "Expected string, received null"
}
]
% npm run drizzle:introspect

> [email protected] drizzle:introspect
> npx drizzle-kit introspect

drizzle-kit: v0.22.8
drizzle-orm: v0.31.2

No config path provided, using default path
Reading config file '/Users/hlab/Development/toro/TP4PT/toro/apps/revocruit-data/drizzle.config.ts'
Pulling from ['public', 'auth'] list of schemas

Using 'postgres' driver for database querying
[✓] 22 tables fetched
[✓] 233 columns fetched
[✓] 10 enums fetched
[✓] 9 indexes fetched
[✓] 32 foreign keys fetched

_ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"columns",
1,
"expression"
],
"message": "Expected string, received null"
}
]
1 Reply
rphlmr ⚡
rphlmr ⚡3mo ago
Could be the auth schema that has some unexpected shape. Can you try but only for public schema? (Use the schema filter in your drizzle config https://orm.drizzle.team/kit-docs/config-reference#schemafilter)
Drizzle ORM - Config Reference
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Want results from more Discord servers?
Add your server