[GH-ISSUE #6746] Prisma 7 no longer allowed as peer dependency since 1.4.7 #19243

Closed
opened 2026-04-15 18:05:42 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @SijmenHuizenga on GitHub (Dec 14, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6746

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Since 1.4.7 prisma is pinned as a peer dependency to ^5.22.0. Happened in #6654. With this, it is no longer possible to use newer prisma versions (6 or 7) with better-auth.

npm error While resolving: project@1.0.0
npm error Found: prisma@7.1.0
npm error node_modules/prisma
npm error   peerOptional prisma@"*" from @prisma/client@7.1.0
npm error   node_modules/@prisma/client
npm error     peerOptional overridden @prisma/client@"7.1.0" (was "^5.22.0") from better-auth@1.4.7
npm error     node_modules/better-auth
npm error       better-auth@"*" from the root project
npm error     peerOptional overridden @prisma/client@"7.1.0" (was "*") from drizzle-orm@0.41.0
npm error     node_modules/drizzle-orm
npm error       peerOptional drizzle-orm@"^0.41.0" from better-auth@1.4.7
npm error       node_modules/better-auth
npm error         better-auth@"*" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional prisma@"^5.22.0" from better-auth@1.4.7
npm error node_modules/better-auth
npm error   better-auth@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

The prisma adapter docs mentions prisma 7, which creates the expectation that v7 is supported.

Current vs. Expected behavior

Support prisma 7

What version of Better Auth are you using?

1.4.7

System info

no output from `npx @better-auth/cli info --json`

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

Package

Auth config (if applicable)


Additional context

Repro:

~/projects/abc $ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (abc)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
type: (commonjs)
About to write to /home/sijmen/projects/abc/package.json:

{
  "name": "abc",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "type": "commonjs"
}


Is this OK? (yes)

~/projects/abc $ npm install --save prisma @prisma/client

added 93 packages, and audited 94 packages in 9s

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
~/projects/abc $ npm install --save better-auth
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: abc@1.0.0
npm error Found: prisma@7.1.0
npm error node_modules/prisma
npm error   prisma@"^7.1.0" from the root project
npm error   peerOptional prisma@"*" from @prisma/client@7.1.0
npm error   node_modules/@prisma/client
npm error     @prisma/client@"^7.1.0" from the root project
npm error     peerOptional @prisma/client@"*" from drizzle-orm@0.41.0
npm error     node_modules/drizzle-orm
npm error       peerOptional drizzle-orm@"^0.41.0" from better-auth@1.4.7
npm error       node_modules/better-auth
npm error         better-auth@"*" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional prisma@"^5.22.0" from better-auth@1.4.7
npm error node_modules/better-auth
npm error   better-auth@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/sijmen/.npm/_logs/2025-12-14T10_36_52_740Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/sijmen/.npm/_logs/2025-12-14T10_36_52_740Z-debug-0.log
~/projects/abc $ cat package.json
{
  "name": "abc",
  "version": "1.0.0",
  "description": "",
  "license": "ISC",
  "author": "",
  "type": "commonjs",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "@prisma/client": "^7.1.0",
    "prisma": "^7.1.0"
  }
}
Originally created by @SijmenHuizenga on GitHub (Dec 14, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6746 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Since 1.4.7 prisma is pinned as a peer dependency to `^5.22.0`. Happened in #6654. With this, it is no longer possible to use newer prisma versions (6 or 7) with better-auth. ``` npm error While resolving: project@1.0.0 npm error Found: prisma@7.1.0 npm error node_modules/prisma npm error peerOptional prisma@"*" from @prisma/client@7.1.0 npm error node_modules/@prisma/client npm error peerOptional overridden @prisma/client@"7.1.0" (was "^5.22.0") from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error peerOptional overridden @prisma/client@"7.1.0" (was "*") from drizzle-orm@0.41.0 npm error node_modules/drizzle-orm npm error peerOptional drizzle-orm@"^0.41.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error npm error Could not resolve dependency: npm error peerOptional prisma@"^5.22.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. ``` The [prisma adapter docs](https://www.better-auth.com/docs/adapters/prisma) mentions prisma 7, which creates the expectation that v7 is supported. ### Current vs. Expected behavior Support prisma 7 ### What version of Better Auth are you using? 1.4.7 ### System info ```bash no output from `npx @better-auth/cli info --json` ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript ``` ### Additional context Repro: ``` ~/projects/abc $ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See `npm help init` for definitive documentation on these fields and exactly what they do. Use `npm install <pkg>` afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. package name: (abc) version: (1.0.0) description: entry point: (index.js) test command: git repository: keywords: author: license: (ISC) type: (commonjs) About to write to /home/sijmen/projects/abc/package.json: { "name": "abc", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "type": "commonjs" } Is this OK? (yes) ~/projects/abc $ npm install --save prisma @prisma/client added 93 packages, and audited 94 packages in 9s 11 packages are looking for funding run `npm fund` for details found 0 vulnerabilities ~/projects/abc $ npm install --save better-auth npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: abc@1.0.0 npm error Found: prisma@7.1.0 npm error node_modules/prisma npm error prisma@"^7.1.0" from the root project npm error peerOptional prisma@"*" from @prisma/client@7.1.0 npm error node_modules/@prisma/client npm error @prisma/client@"^7.1.0" from the root project npm error peerOptional @prisma/client@"*" from drizzle-orm@0.41.0 npm error node_modules/drizzle-orm npm error peerOptional drizzle-orm@"^0.41.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error npm error Could not resolve dependency: npm error peerOptional prisma@"^5.22.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error /home/sijmen/.npm/_logs/2025-12-14T10_36_52_740Z-eresolve-report.txt npm error A complete log of this run can be found in: /home/sijmen/.npm/_logs/2025-12-14T10_36_52_740Z-debug-0.log ~/projects/abc $ cat package.json { "name": "abc", "version": "1.0.0", "description": "", "license": "ISC", "author": "", "type": "commonjs", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { "@prisma/client": "^7.1.0", "prisma": "^7.1.0" } } ```
GiteaMirror added the locked label 2026-04-15 18:05:42 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 14, 2025):

Hi @SijmenHuizenga! I'm Dosu and I’m helping the better-auth team.

Better Auth 1.4.7 pins both prisma and @prisma/client as peer dependencies to ^5.22.0, which blocks installation with Prisma 6 or 7 and causes the npm ERESOLVE error you’re seeing. This restriction was introduced in PR #6654, but the PR doesn’t document a specific reason or mention Prisma 7 support.

The docs mention Prisma 7 and describe required config changes, but the actual package.json restriction prevents using Prisma 7.x out of the box. There’s no official CLI or generator support for Prisma 7 yet, even though the adapter itself is fundamentally compatible if you manually update your setup.

If you want to use Better Auth with Prisma 7, you’ll need to:

  • After every CLI run, manually move connection settings (url, directUrl, shadowDatabaseUrl) from schema.prisma to a new prisma.config.ts file.
  • Change the generator provider from "prisma-client-js" to "prisma-client".
  • Update your import paths to use the generated client (e.g., import { PrismaClient } from "@/generated/prisma/client").
  • Explicitly use the correct Prisma adapter package (like @prisma/adapter-pg for PostgreSQL).
  • Make sure all model and field names in your Better Auth config match your Prisma schema, and fields used in where clauses are marked as @unique.
  • Repeat these manual changes after every CLI run, since the CLI will overwrite them.

These workarounds are required because the CLI and schema generator don’t yet fully support Prisma 7, and skipping them can cause silent failures in update operations (like updateUser or changeEmail) source source source.

Some users have reported that using pnpm instead of npm can bypass the dependency conflict, but this isn’t guaranteed or officially documented source.

Maintainers are aware of the issue and working on full Prisma 7 support, but there’s no automated fix or official release yet. You can follow progress or find more details in these threads: #6469, #6277, #6529.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

<!-- gh-comment-id:3650689067 --> @dosubot[bot] commented on GitHub (Dec 14, 2025): <!-- Greeting --> Hi @SijmenHuizenga! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> Better Auth 1.4.7 pins both prisma and @prisma/client as peer dependencies to ^5.22.0, which blocks installation with Prisma 6 or 7 and causes the npm ERESOLVE error you’re seeing. This restriction was introduced in [PR #6654](https://github.com/better-auth/better-auth/pull/6654), but the PR doesn’t document a specific reason or mention Prisma 7 support. The docs mention Prisma 7 and describe required config changes, but the actual package.json restriction prevents using Prisma 7.x out of the box. There’s no official CLI or generator support for Prisma 7 yet, even though the adapter itself is fundamentally compatible if you manually update your setup. If you want to use Better Auth with Prisma 7, you’ll need to: - After every CLI run, manually move connection settings (url, directUrl, shadowDatabaseUrl) from schema.prisma to a new prisma.config.ts file. - Change the generator provider from "prisma-client-js" to "prisma-client". - Update your import paths to use the generated client (e.g., import { PrismaClient } from "@/generated/prisma/client"). - Explicitly use the correct Prisma adapter package (like @prisma/adapter-pg for PostgreSQL). - Make sure all model and field names in your Better Auth config match your Prisma schema, and fields used in where clauses are marked as @unique. - Repeat these manual changes after every CLI run, since the CLI will overwrite them. These workarounds are required because the CLI and schema generator don’t yet fully support Prisma 7, and skipping them can cause silent failures in update operations (like updateUser or changeEmail) [source](https://github.com/better-auth/better-auth/issues/6469) [source](https://github.com/better-auth/better-auth/issues/6277) [source](https://github.com/better-auth/better-auth/discussions/6529). Some users have reported that using pnpm instead of npm can bypass the dependency conflict, but this isn’t guaranteed or officially documented [source](https://github.com/better-auth/better-auth/issues/4305). Maintainers are aware of the issue and working on full Prisma 7 support, but there’s no automated fix or official release yet. You can follow progress or find more details in these threads: [#6469](https://github.com/better-auth/better-auth/issues/6469), [#6277](https://github.com/better-auth/better-auth/issues/6277), [#6529](https://github.com/better-auth/better-auth/discussions/6529). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c219bffa-b1be-4c84-b2e0-2822ee1de285?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Better%20Auth%201.4.7%20pins%20both%20prisma%20and%20%40prisma/client%20as%20peer%20dependencies%20to%20%5E5.22.0%2C%20which%20blocks%20installation%20with%20Prisma%206%20or%207%20and%20causes%20the%20npm%20ERESOLVE%20error%20you%E2%80%99re%20seeing.%20This%20restriction%20was%20introduced%20in%20%5BPR%20%236654%5D%28https%3A//github.com/better-auth/better-auth/pull/6654%29%2C%20but%20the%20PR%20doesn%E2%80%99t%20document%20a%20specific%20reason%20or%20mention%20Prisma%207%20support.%0A%0AThe%20docs%20mention%20Prisma%207%20and%20describe%20required%20config%20changes%2C%20but%20the%20actual%20package.json%20restriction%20prevents%20using%20Prisma%207.x%20out%20of%20the%20box.%20There%E2%80%99s%20no%20official%20CLI%20or%20generator%20support%20for%20Prisma%207%20yet%2C%20even%20though%20the%20adapter%20itself%20is%20fundamentally%20compatible%20if%20you%20manually%20update%20your%20setup.%0A%0AIf%20you%20want%20to%20use%20Better%20Auth%20with%20Prisma%207%2C%20you%E2%80%99ll%20need%20to%3A%0A-%20After%20every%20CLI%20run%2C%20manually%20move%20connection%20settings%20%28url%2C%20directUrl%2C%20shadowDatabaseUrl%29%20from%20schema.prisma%20to%20a%20new%20prisma.config.ts%20file.%0A-%20Change%20the%20generator%20provider%20from%20%22prisma-client-js%22%20to%20%22prisma-client%22.%0A-%20Update%20your%20import%20paths%20to%20use%20the%20generated%20client%20%28e.g.%2C%20import%20%7B%20PrismaClient%20%7D%20from%20%22%40/generated/prisma/client%22%29.%0A-%20Explicitly%20use%20the%20correct%20Prisma%20adapter%20package%20%28like%20%40prisma/adapter-pg%20for%20PostgreSQL%29.%0A-%20Make%20sure%20all%20model%20and%20field%20names%20in%20your%20Better%20Auth%20config%20match%20your%20Prisma%20schema%2C%20and%20fields%20used%20in%20where%20clauses%20are%20marked%20as%20%40unique.%0A-%20Repeat%20these%20manual%20changes%20after%20every%20CLI%20run%2C%20since%20the%20CLI%20will%20overwrite%20them.%0A%0AThese%20workarounds%20are%20required%20because%20the%20CLI%20and%20schema%20generator%20don%E2%80%99t%20yet%20fully%20support%20Prisma%207%2C%20and%20skipping%20them%20can%20cause%20silent%20failures%20in%20update%20operations%20%28like%20updateUser%20or%20changeEmail%29%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6469%29%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6277%29%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/discussions/6529%29.%0A%0ASome%20users%20have%20reported%20that%20using%20pnpm%20instead%20of%20npm%20can%20bypass%20the%20dependency%20conflict%2C%20but%20this%20isn%E2%80%99t%20guaranteed%20or%20officially%20documented%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/4305%29.%0A%0AMaintainers%20are%20aware%20of%20the%20issue%20and%20working%20on%20full%20Prisma%207%20support%2C%20but%20there%E2%80%99s%20no%20automated%20fix%20or%20official%20release%20yet.%20You%20can%20follow%20progress%20or%20find%20more%20details%20in%20these%20threads%3A%20%5B%236469%5D%28https%3A//github.com/better-auth/better-auth/issues/6469%29%2C%20%5B%236277%5D%28https%3A//github.com/better-auth/better-auth/issues/6277%29%2C%20%5B%236529%5D%28https%3A//github.com/better-auth/better-auth/discussions/6529%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/6746)
Author
Owner

@drMonro commented on GitHub (Dec 14, 2025):

@dosu So does it mean that in version 1.4.6 Prisma 6 and 7 were supported, but in 1.4.7 they are not? I’m a bit confused.

What should I do in this case — stay on 1.4.6, or install 1.4.7 using --legacy-peer-deps?

<!-- gh-comment-id:3651233718 --> @drMonro commented on GitHub (Dec 14, 2025): @dosu So does it mean that in version 1.4.6 Prisma 6 and 7 were supported, but in 1.4.7 they are not? I’m a bit confused. What should I do in this case — stay on 1.4.6, or install 1.4.7 using --legacy-peer-deps?
Author
Owner

@kumardeepakme commented on GitHub (Dec 14, 2025):

Installing better-auth with Prisma 7 currently fails due to a strict peer dependency constraint.

better-auth declares:

peerOptional prisma "^5.22.0"

With npm v7+, this causes an ERESOLVE error when using:

  • prisma@7.x
  • @prisma/client@7.x

This appears to be a peer dependency range issue rather than a hard incompatibility, as Prisma 7 works when bypassing peer checks.

It would be great if better-auth could either:

  • officially support Prisma 7 out of the box, or
  • widen the peer range (e.g. ^5.22.0 || ^6 || ^7) to avoid blocking installs.

Relying on npm install --legacy-peer-deps for every update isn’t ideal long-term.

<!-- gh-comment-id:3651370129 --> @kumardeepakme commented on GitHub (Dec 14, 2025): Installing **better-auth** with **Prisma 7** currently fails due to a strict peer dependency constraint. `better-auth` declares: ``` peerOptional prisma "^5.22.0" ``` With npm v7+, this causes an `ERESOLVE` error when using: * `prisma@7.x` * `@prisma/client@7.x` This appears to be a peer dependency range issue rather than a hard incompatibility, as Prisma 7 works when bypassing peer checks. It would be great if `better-auth` could either: * officially support Prisma 7 out of the box, or * widen the peer range (e.g. `^5.22.0 || ^6 || ^7`) to avoid blocking installs. Relying on `npm install --legacy-peer-deps` for every update isn’t ideal long-term.
Author
Owner

@davoodjavidi commented on GitHub (Dec 16, 2025):

install the previous version of better-auth
npm install better-auth@1.4.6
it should work.

<!-- gh-comment-id:3662887764 --> @davoodjavidi commented on GitHub (Dec 16, 2025): install the previous version of better-auth npm install better-auth@1.4.6 it should work.
Author
Owner

@kris2tis commented on GitHub (Dec 21, 2025):

install the previous version of better-auth npm install better-auth@1.4.6 it should work.

thank you brother
This worked ✔

<!-- gh-comment-id:3678600576 --> @kris2tis commented on GitHub (Dec 21, 2025): > install the previous version of better-auth npm install better-auth@1.4.6 it should work. thank you brother This worked ✔
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19243