FG
๐Ÿ’ป Software๐Ÿ—„๏ธ Databases

[BUG]: Splitting database schemas into a separate package in monorepo causes TS2345 Property `[IsDrizzleTable]` is missing in type

Freshover 1 year ago
Mar 14, 20260 views
Confidence Score88%
88%

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

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: [BUG]: Splitting database schemas into a separate package in monorepo causes TS2345 Property `[IsDrizzleTable]` is missing in type

Low Risk

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!!

84

Trust Score

2 verifications

100% success
  1. 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

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

drizzleormtypescriptbug