fix(drizzle-kit): add drizzle-orm as peerDependency#5574
Open
frenzzy wants to merge 1 commit intodrizzle-team:betafrom
Open
fix(drizzle-kit): add drizzle-orm as peerDependency#5574frenzzy wants to merge 1 commit intodrizzle-team:betafrom
frenzzy wants to merge 1 commit intodrizzle-team:betafrom
Conversation
drizzle-kit's build.ts marks drizzle-orm as external in esbuild, so
bin.cjs emits require('drizzle-orm/...') calls at runtime (including
the new _relations subpath). However, drizzle-orm is not declared as a
dependency or peerDependency — it only appears as a devDependency with
a workspace:./path reference that is published as-is to npm.
This causes "Cannot find module 'drizzle-orm/_relations'" errors in npm
workspace monorepos when drizzle-orm cannot be hoisted to the root
node_modules (e.g., due to conflicting peer dependencies from other
packages).
Adding drizzle-orm as a peerDependency ensures npm resolves it
correctly in all workspace layouts.
Fixes drizzle-team#5573
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
drizzle-kit'sbuild.tsmarksdrizzle-ormasexternalin esbuild, sobin.cjsemitsrequire('drizzle-orm/...')calls at runtime (including the new_relationssubpath)drizzle-ormis not declared as adependencyorpeerDependency— it only appears as adevDependencywith aworkspace:./pathreference that is published as-is to npmCannot find module 'drizzle-orm/_relations'errors in npm workspace monorepos whendrizzle-ormcannot be hoisted to the rootnode_modules/(e.g., due to conflicting peer dependencies from other packages)drizzle-ormas apeerDependency(consistent withdrizzle-seed's approach) to ensure npm resolves it correctly in all workspace layoutsFixes #5573