[GH-ISSUE #8441] Better Auth 1.5.4 installs unused Prisma adapter #11091

Closed
opened 2026-04-13 07:28:25 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @hai-trung-le on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8441

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

#8401 moves all @better-auth/<x>-adapter packages into the dependencies of better-auth, which installs the heavy and unused database clients like mongodb and prisma. This is because npm v7+ installs peer dependencies by default, and the adapter packages don't specify that the database clients are optional in peerDependenciesMeta.

This can be fixed by following Copilot suggestion here: https://github.com/better-auth/better-auth/pull/8401#discussion_r2886883898

Current vs. Expected behavior

  1. Run npm i better-auth@1.5.4
  2. Observe "node_modules" now contains "mongodb" and "prisma"

What version of Better Auth are you using?

1.5.4

System info

Windows 10
Node.js 24.11.1
npm 11.11.0

Which area(s) are affected? (Select all that apply)

Package

Auth config (if applicable)


Additional context

No response

Originally created by @hai-trung-le on GitHub (Mar 6, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8441 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce #8401 moves all `@better-auth/<x>-adapter` packages into the dependencies of `better-auth`, which installs the heavy and unused database clients like mongodb and prisma. This is because npm v7+ installs peer dependencies by default, and the adapter packages don't specify that the database clients are optional in `peerDependenciesMeta`. This can be fixed by following Copilot suggestion here: https://github.com/better-auth/better-auth/pull/8401#discussion_r2886883898 ### Current vs. Expected behavior 1. Run `npm i better-auth@1.5.4` 2. Observe "node_modules" now contains "mongodb" and "prisma" ### What version of Better Auth are you using? 1.5.4 ### System info ```bash Windows 10 Node.js 24.11.1 npm 11.11.0 ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 07:28:25 -05:00
Author
Owner

@himself65 commented on GitHub (Mar 6, 2026):

https://github.com/better-auth/better-auth/pull/8449

<!-- gh-comment-id:4013109690 --> @himself65 commented on GitHub (Mar 6, 2026): https://github.com/better-auth/better-auth/pull/8449
Author
Owner

@himself65 commented on GitHub (Mar 6, 2026):

This is an issue since 1.5, when we split the adapter into separate packages. This causes some deps and peer deps issues

<!-- gh-comment-id:4013112945 --> @himself65 commented on GitHub (Mar 6, 2026): This is an issue since 1.5, when we split the adapter into separate packages. This causes some deps and peer deps issues
Author
Owner

@himself65 commented on GitHub (Mar 6, 2026):

I tried pkg size. I think it won't happened

<!-- gh-comment-id:4013179768 --> @himself65 commented on GitHub (Mar 6, 2026): I tried pkg size. I think it won't happened
Author
Owner

@mmikhan commented on GitHub (Mar 7, 2026):

Just came across this. I am using drizzle, installed the new drizzle provider but still seeing the Prisma as peer dependencies from multiple places coming from Better Auth. In fact, Prisma appears to be as a Drizzle peer deps 🤔

pnpm install

 WARN  Issues with peer dependencies found
packages/auth
└─┬ prisma 7.4.2
  └─┬ @prisma/config 7.4.2
    └─┬ c12 3.1.0
      └── ✕ unmet peer magicast@^0.3.5: found 0.5.2

pnpm --filter @workspace/auth why prisma

dependencies:
@better-auth/drizzle-adapter 1.5.4
└─┬ drizzle-orm 0.45.1 peer
  ├─┬ @prisma/client 7.4.2 peer
  │ └── prisma 7.4.2 peer
  └── prisma 7.4.2 peer
@better-auth/stripe 1.5.4
└─┬ better-auth 1.5.4 peer
  ├─┬ @better-auth/drizzle-adapter 1.5.4
  │ └─┬ drizzle-orm 0.45.1 peer
  │   ├─┬ @prisma/client 7.4.2 peer
  │   │ └── prisma 7.4.2 peer
  │   └── prisma 7.4.2 peer
  ├─┬ @better-auth/prisma-adapter 1.5.4
  │ ├─┬ @prisma/client 7.4.2 peer
  │ │ └── prisma 7.4.2 peer
  │ └── prisma 7.4.2 peer
  ├─┬ @prisma/client 7.4.2 peer
  │ └── prisma 7.4.2 peer
  ├─┬ drizzle-orm 0.45.1 peer
  │ ├─┬ @prisma/client 7.4.2 peer
  │ │ └── prisma 7.4.2 peer
  │ └── prisma 7.4.2 peer
  └── prisma 7.4.2 peer
<!-- gh-comment-id:4014971456 --> @mmikhan commented on GitHub (Mar 7, 2026): Just came across this. I am using drizzle, installed the new drizzle provider but still seeing the Prisma as peer dependencies from multiple places coming from Better Auth. In fact, Prisma appears to be as a Drizzle peer deps 🤔 `pnpm install` ```sh  WARN  Issues with peer dependencies found packages/auth └─┬ prisma 7.4.2 └─┬ @prisma/config 7.4.2 └─┬ c12 3.1.0 └── ✕ unmet peer magicast@^0.3.5: found 0.5.2 ``` `pnpm --filter @workspace/auth why prisma` ```sh dependencies: @better-auth/drizzle-adapter 1.5.4 └─┬ drizzle-orm 0.45.1 peer ├─┬ @prisma/client 7.4.2 peer │ └── prisma 7.4.2 peer └── prisma 7.4.2 peer @better-auth/stripe 1.5.4 └─┬ better-auth 1.5.4 peer ├─┬ @better-auth/drizzle-adapter 1.5.4 │ └─┬ drizzle-orm 0.45.1 peer │ ├─┬ @prisma/client 7.4.2 peer │ │ └── prisma 7.4.2 peer │ └── prisma 7.4.2 peer ├─┬ @better-auth/prisma-adapter 1.5.4 │ ├─┬ @prisma/client 7.4.2 peer │ │ └── prisma 7.4.2 peer │ └── prisma 7.4.2 peer ├─┬ @prisma/client 7.4.2 peer │ └── prisma 7.4.2 peer ├─┬ drizzle-orm 0.45.1 peer │ ├─┬ @prisma/client 7.4.2 peer │ │ └── prisma 7.4.2 peer │ └── prisma 7.4.2 peer └── prisma 7.4.2 peer ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#11091