TS2345: PgTableWithColumns<…> from buildable shared-lib not assignable to PgTable<TableConfig>
I’m working in an Nx monorepo with a shared-lib and a Node.js API. Both use Drizzle-ORM (same version), but my API imports tables from the shared-lib. When I try to join one of those tables, TypeScript complains about a type mismatch.
Why does TypeScript see a PgTableWithColumns<…> from my shared-lib as different from the PgTable<TableConfig> expected by .leftJoin, even though both come from the same Drizzle-ORM package? How can I fix this so shared-lib tables join cleanly in my API?
"drizzle-kit": "^0.31.1",
"drizzle-orm": "^0.44.0",
"drizzle-seed": "^0.3.1",
"drizzle-zod": "^0.8.2",
"zod": "^3.25.42"
I'm using zod/v4 everywhere.
Why does TypeScript see a PgTableWithColumns<…> from my shared-lib as different from the PgTable<TableConfig> expected by .leftJoin, even though both come from the same Drizzle-ORM package? How can I fix this so shared-lib tables join cleanly in my API?
"drizzle-kit": "^0.31.1",
"drizzle-orm": "^0.44.0",
"drizzle-seed": "^0.3.1",
"drizzle-zod": "^0.8.2",
"zod": "^3.25.42"
I'm using zod/v4 everywhere.