[BUG]: drizzle-kit@1.0.0-beta.20 missing drizzle-orm peerDependency causes 'Cannot find module' in npm workspaces
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- tooling
Research direction
Start by checking the drizzle-kit package manifest and the generated bin.cjs entry point, especially the external drizzle-orm requires on lines 59-67. Reproduce the install in an npm workspace with the conflicting peer dependency, then verify that the published package declares the runtime requirement and that drizzle-kit generate no longer reports the missing module.
Written by the indexing model from the issue text.
Description
Report hasn't been filed before.
- I have verified that the bug I'm about to report hasn't been filed before.
What version of drizzle-orm are you using?
1.0.0-beta.20
What version of drizzle-kit are you using?
1.0.0-beta.20
Other packages
npm 11.6.2, Node.js 24.13.0
Describe the Bug
drizzle-kit@1.0.0-beta.20's bin.cjs does external require('drizzle-orm/...') calls (line 59-67), but drizzle-orm is not declared as a peerDependency or dependency in the published package.
In the source repo, drizzle-orm is listed as a devDependency with workspace:./drizzle-orm/dist. This workspace: path reference is published as-is to npm (pnpm does not transform workspace:./path syntax during publish, only workspace:* / workspace:^).
Published drizzle-kit@1.0.0-beta.20 on npm:
{
"dependencies": {
"@drizzle-team/brocli": "^0.11.0",
"@js-temporal/polyfill": "^0.5.1",
"esbuild": "^0.25.10",
"get-tsconfig": "^4.13.6",
"jiti": "^2.6.1"
},
"devDependencies": {
"drizzle-kit": "^0.31.6",
"drizzle-orm": "workspace:./drizzle-orm/dist"
}
}
Note: drizzle-orm is completely absent from dependencies and peerDependencies.
bin.cjs requires drizzle-orm externally:
// bin.cjs lines 59-67
let drizzle_orm__relations = require("drizzle-orm/_relations");
let drizzle_orm = require("drizzle-orm");
let drizzle_orm_pg_core = require("drizzle-orm/pg-core");
let drizzle_orm_casing = require("drizzle-orm/casing");
// ... etc
This works by accident in flat node_modules layouts where drizzle-orm happens to be hoisted to the root. But it breaks in npm workspaces when another package has a conflicting peer dependency on drizzle-orm (e.g., fraci@0.18.0 requires drizzle-orm >= 0.30.0 < 0.45.0), preventing npm from hoisting drizzle-orm@1.0.0-beta.20 to the root node_modules/.
In this case drizzle-kit is hoisted to root node_modules/drizzle-kit/, but drizzle-orm only exists in each workspace's node_modules/, so require('drizzle-orm/_relations') fails.
Expected behavior
drizzle-kit should declare drizzle-orm as a peerDependency in package.json:
{
"peerDependencies": {
"drizzle-orm": ">=1.0.0-beta.1"
}
}
This would tell npm that drizzle-kit needs drizzle-orm available at runtime and ensure proper resolution in monorepo/workspace setups.
Environment & setup
- OS: macOS (Darwin 25.4.0)
- Package manager: npm 11.6.2
- Monorepo: npm workspaces
- Node.js: 24.13.0
Reproduction
- Create an npm workspace monorepo
- Add
drizzle-orm@1.0.0-beta.20anddrizzle-kit@1.0.0-beta.20to a workspace package - Add another dependency that has a conflicting peer dep on
drizzle-orm(e.g.,fraci@0.18.0which requiresdrizzle-orm < 0.45.0) - Run
npm install - Run
drizzle-kit generate
Error: Cannot find module 'drizzle-orm/_relations'
Require stack:
- /path/to/node_modules/drizzle-kit/bin.cjs
Workaround
Add drizzle-orm to the root package.json dependencies and use --legacy-peer-deps to force hoisting despite the peer dep conflict.
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from drizzle-team/drizzle-orm
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
drizzle-team/drizzle-orm#6287 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
drizzle-team/drizzle-orm#6229 ·
-
bug drizzle/kit
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
drizzle-team/drizzle-orm#6214 ·
-
bug bug/fixed-in-beta drizzle/kit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drizzle-team/drizzle-orm#6192 · 3 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
drizzle-team/drizzle-orm#6162 · 3 comments · 1 reaction ·
All issues in drizzle-team/drizzle-orm
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100