[BUG]: Splitting database schemas into a separate package in monorepo causes TS2345 Property `[IsDrizzleTable]` is missing in type
Problem
What version of `drizzle-orm` are you using? 0.29.0 What version of `drizzle-kit` are you using? 0.20.4 (but not relevant) Describe the Bug 1. Copy/paste the example drizzle adapter code from https://github.com/nextauthjs/next-auth/blob/693a0723a7bad2b0950e4c6006a99c98852c4beb/packages/adapter-drizzle/src/lib/pg.ts into my own project 2. Note that the example code works (leave aside the deprecated `primaryKey(col1, col2)`, which I fixed). 3. My project is a monorepo, so the database schemas (which were in Prisma) are in a separate package. Move the table definitions for `users`, `accounts`, `sessions`, and `verificationTokens` into a separate package, where `tsc --build` is producing a `dist/` folder and `package.json`'s `exports` references `dist/index.d.ts` etc., then import the table definitions in the original `app` package which is making the `insert` calls. 4. Receive the following error: `TS2345` and `Property [isDrizzleTable] is missing in type`: the compiled `.d.ts` looks like this: Expected behavior Not to have the `tsc` error. I expect the types to be portable. Environment & setup I use a monorepo with `pnpm` and `syncpack` and have confirmed that both the main `app` package and the database schema package are using the same `0.29.0` version of `drizzle-orm`.
Error Output
error: `TS2345` and `Property [isDrizzleTable] is missing in type`:
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG]: Splitting database schemas into a separate package in monorepo causes TS2345 Property `[IsDrizzleTable]` is missing in type
Fixed! It was because I was using different versions of drizzle orm inside my workspaces. So if you update all the drizzle orms to the same version it will work nicely!!
Trust Score
2 verifications
- 1
It was because I was using different versions of drizzle orm inside my workspace
It was because I was using different versions of drizzle orm inside my workspaces. So if you update all the drizzle orms to the same version it will work nicely!!
Validation
Resolved in drizzle-team/drizzle-orm GitHub issue #1558. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep