Incompatible with Next.js 16 - Peer dependency needs update #2428

Closed
opened 2026-03-13 09:53:30 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @whoismaruf on GitHub (Dec 1, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Initialise a new Next.js 16 project with the following dependencies:
{
  "dependencies": {
    "next": "16.0.6",
    "react": "19.2.0",
    "react-dom": "19.2.0"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "16.0.6",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}
  1. Attempt to install better-auth:
    npm install better-auth

  2. Observe the peer dependency error

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: better-auth@1.4.4
npm error Found: next@16.0.6
npm error node_modules/next
npm error   next@"16.0.6" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4
npm error node_modules/better-auth
npm error   better-auth@"*" from the root project
npm error
npm error Conflicting peer dependency: next@15.5.6
npm error node_modules/next
npm error   peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4
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 C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-debug-0.log

Expected result: Package should install successfully

Actual result: Installation fails with peer dependency conflict error

Current vs. Expected behavior

Current Behaviour

Cannot install better-auth with Next.js 16.0.6
Peer dependency check blocks installation
Error message suggests conflicting peer dependency
Forces users to use --legacy-peer-deps flag which bypasses safety checks
Creates uncertainty about compatibility with Next.js 16

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: better-auth@1.4.4
npm error Found: next@16.0.6
npm error node_modules/next
npm error   next@"16.0.6" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4
npm error node_modules/better-auth
npm error   better-auth@"*" from the root project
npm error
npm error Conflicting peer dependency: next@15.5.6
npm error node_modules/next
npm error   peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4
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 C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-debug-0.log

Expected Behaviour

Should install cleanly with Next.js 16.0.6
Peer dependency should accept next@^16.0.0
No warnings or errors during installation
Official support/confirmation for Next.js 16 compatibility
Seamless developer experience with the latest Next.js version

What version of Better Auth are you using?

1.4.4

System info

{
  "system": {
    "platform": "win32",
    "arch": "x64",
    "version": "Windows 11 Home Single Language",
    "release": "10.0.26200",
    "cpuCount": 8,
    "cpuModel": "Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz",
    "totalMemory": "15.79 GB",
    "freeMemory": "3.29 GB"
  },
  "node": {
    "version": "v22.14.0",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "11.6.3"
  },
  "frameworks": null,
  "databases": null,
  "betterAuth": {
    "version": "Unknown",
    "config": null,
    "error": "ENOENT: no such file or directory, open 'C:\\Users\\maruf\\package.json'"
  }
}

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

Package

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @whoismaruf on GitHub (Dec 1, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Initialise a new Next.js 16 project with the following dependencies: ```josn { "dependencies": { "next": "16.0.6", "react": "19.2.0", "react-dom": "19.2.0" }, "devDependencies": { "@tailwindcss/postcss": "^4", "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "16.0.6", "tailwindcss": "^4", "typescript": "^5" } } ``` 2. Attempt to install better-auth: `npm install better-auth` 3. Observe the peer dependency error ```sh npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: better-auth@1.4.4 npm error Found: next@16.0.6 npm error node_modules/next npm error next@"16.0.6" from the root project npm error npm error Could not resolve dependency: npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error npm error Conflicting peer dependency: next@15.5.6 npm error node_modules/next npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4 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 C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-debug-0.log ``` Expected result: Package should install successfully Actual result: Installation fails with peer dependency conflict error ### Current vs. Expected behavior ### Current Behaviour ❌ Cannot install better-auth with Next.js 16.0.6 ❌ Peer dependency check blocks installation ❌ Error message suggests conflicting peer dependency ❌ Forces users to use --legacy-peer-deps flag which bypasses safety checks ❌ Creates uncertainty about compatibility with Next.js 16 ```sh npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: better-auth@1.4.4 npm error Found: next@16.0.6 npm error node_modules/next npm error next@"16.0.6" from the root project npm error npm error Could not resolve dependency: npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4 npm error node_modules/better-auth npm error better-auth@"*" from the root project npm error npm error Conflicting peer dependency: next@15.5.6 npm error node_modules/next npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4 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 C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\maruf\AppData\Local\npm-cache\_logs\2025-12-01T03_57_13_514Z-debug-0.log ``` ### Expected Behaviour ✅ Should install cleanly with Next.js 16.0.6 ✅ Peer dependency should accept next@^16.0.0 ✅ No warnings or errors during installation ✅ Official support/confirmation for Next.js 16 compatibility ✅ Seamless developer experience with the latest Next.js version ### What version of Better Auth are you using? 1.4.4 ### System info ```bash { "system": { "platform": "win32", "arch": "x64", "version": "Windows 11 Home Single Language", "release": "10.0.26200", "cpuCount": 8, "cpuModel": "Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz", "totalMemory": "15.79 GB", "freeMemory": "3.29 GB" }, "node": { "version": "v22.14.0", "env": "development" }, "packageManager": { "name": "npm", "version": "11.6.3" }, "frameworks": null, "databases": null, "betterAuth": { "version": "Unknown", "config": null, "error": "ENOENT: no such file or directory, open 'C:\\Users\\maruf\\package.json'" } } ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the nextjs label 2026-03-13 09:53:30 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 1, 2025):

Hi there! Thanks for reaching out. It looks like Better Auth v1.4.4 currently specifies support for Next.js versions ^14.0.0 or ^15.0.0, which is why you're encountering a peer dependency conflict with Next.js 16. To work around this issue temporarily, you could either downgrade to a supported Next.js version or install using the --legacy-peer-deps flag, though the latter bypasses safety checks. Our team is aware of this limitation and is considering updating the peer dependency requirements to include Next.js 16 in a future release [1].

Is this workaround helpful, or would you like further assistance? Tag @better-auth-agent if you would like an answer from the Agent.

If you need more help, tag @Skyvern in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Dec 1, 2025): Hi there! Thanks for reaching out. It looks like Better Auth v1.4.4 currently specifies support for Next.js versions ^14.0.0 or ^15.0.0, which is why you're encountering a peer dependency conflict with Next.js 16. To work around this issue temporarily, you could either downgrade to a supported Next.js version or install using the --legacy-peer-deps flag, though the latter bypasses safety checks. Our team is aware of this limitation and is considering updating the peer dependency requirements to include Next.js 16 in a future release [[1]](https://github.com/better-auth/better-auth/issues/4862). Is this workaround helpful, or would you like further assistance? Tag @better-auth-agent if you would like an answer from the Agent. _If you need more help, tag @Skyvern in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@MarcJose commented on GitHub (Dec 1, 2025):

Same issue here, we had v1.4.3 installed with NextJs 16 and now we cannot update to v1.4.4 because it does not support NextJs 16 anymore?
Since the documentation explicitely mentions support I guess it was just a mistake in the dependency pinning:
Quote: "Better Auth is fully compatible with Next.js 16."
https://www.better-auth.com/docs/integrations/next#nextjs-16-compatibility

Edit: Just saw this PR https://github.com/better-auth/better-auth/pull/6430 which should fix it already

@MarcJose commented on GitHub (Dec 1, 2025): Same issue here, we had v1.4.3 installed with NextJs 16 and now we cannot update to v1.4.4 because it does not support NextJs 16 anymore? Since the documentation explicitely mentions support I guess it was just a mistake in the dependency pinning: Quote: "Better Auth is fully compatible with Next.js 16." https://www.better-auth.com/docs/integrations/next#nextjs-16-compatibility Edit: Just saw this PR https://github.com/better-auth/better-auth/pull/6430 which should fix it already
Author
Owner

@Romflz commented on GitHub (Dec 2, 2025):

Same issue here. Tried updating from 1.3.x to 1.4.4. Got this:

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: better-auth@1.4.4
npm error Found: next@16.0.1
npm error node_modules/next
npm error   peer next@"^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-beta.0" from @next/third-parties@16.0.1
npm error   node_modules/@next/third-parties
npm error     @next/third-parties@"^16.0.1" from the root project
npm error   peer next@"^13.2.0 || ^14.0 || ^15.0.0-rc.0 || ^16.0.0-0" from @sentry/nextjs@10.24.0
npm error   node_modules/@sentry/nextjs
npm error     @sentry/nextjs@"^10.24.0" from the root project
npm error   3 more (@vercel/analytics, nextjs-toploader, the root project)
npm error
npm error Could not resolve dependency:
npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4
npm error node_modules/better-auth
npm error   better-auth@"1.4.4" from the root project
npm error
npm error Conflicting peer dependency: next@15.5.6
npm error node_modules/next
npm error   peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4
npm error   node_modules/better-auth
npm error     better-auth@"1.4.4" 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.
@Romflz commented on GitHub (Dec 2, 2025): Same issue here. Tried updating from 1.3.x to 1.4.4. Got this: ``` npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: better-auth@1.4.4 npm error Found: next@16.0.1 npm error node_modules/next npm error peer next@"^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-beta.0" from @next/third-parties@16.0.1 npm error node_modules/@next/third-parties npm error @next/third-parties@"^16.0.1" from the root project npm error peer next@"^13.2.0 || ^14.0 || ^15.0.0-rc.0 || ^16.0.0-0" from @sentry/nextjs@10.24.0 npm error node_modules/@sentry/nextjs npm error @sentry/nextjs@"^10.24.0" from the root project npm error 3 more (@vercel/analytics, nextjs-toploader, the root project) npm error npm error Could not resolve dependency: npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4 npm error node_modules/better-auth npm error better-auth@"1.4.4" from the root project npm error npm error Conflicting peer dependency: next@15.5.6 npm error node_modules/next npm error peerOptional next@"^14.0.0 || ^15.0.0" from better-auth@1.4.4 npm error node_modules/better-auth npm error better-auth@"1.4.4" 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. ```
Author
Owner

@jslno commented on GitHub (Dec 2, 2025):

Updating to v1.4.4-beta.3 should solve it.

@jslno commented on GitHub (Dec 2, 2025): Updating to `v1.4.4-beta.3` should solve it.
Author
Owner

@himself65 commented on GitHub (Dec 2, 2025):

Please try v1.4.5-beta.1

@himself65 commented on GitHub (Dec 2, 2025): Please try v1.4.5-beta.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2428