[GH-ISSUE #6778] Drizzle peer dependency out of date #19257

Closed
opened 2026-04-15 18:06:56 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @jonbnewman on GitHub (Dec 15, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6778

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Setup an application using better-auth 1.4.6
  2. Install latest drizzle-orm (0.45.1)
  3. (try to) Upgrade to better-auth 1.4.7 (I use ncu -u && npm i)
  4. See the following error:
    npm error node_modules/drizzle-orm
    npm error   drizzle-orm@"^0.45.1" from the root project
    npm error
    npm error Could not resolve dependency:
    npm error peerOptional drizzle-orm@"^0.41.0" from better-auth@1.4.7
    npm error node_modules/better-auth
    npm error   better-auth@"^1.4.7" from the root project
    npm error   better-auth@"^1.4.7" from @better-auth/cli@1.4.7
    npm error   node_modules/@better-auth/cli
    npm error     @better-auth/cli@"^1.4.7" from the root project
    npm error
    npm error Conflicting peer dependency: drizzle-orm@0.41.0
    

Current vs. Expected behavior

CURRENT: Does not work with latest drizzle-orm
EXPECTED: I expect better-auth to work with the latest drizzle-orm

What version of Better Auth are you using?

1.4.7

System info

{
  "system": {
    "platform": "linux",
    "arch": "x64",
    "version": "#1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025",
    "release": "6.6.87.2-microsoft-standard-WSL2",
    "cpuCount": 32,
    "cpuModel": "AMD Ryzen 9 9950X3D 16-Core Processor",
    "totalMemory": "124.59 GB",
    "freeMemory": "120.17 GB"
  },
  "node": {
    "version": "v22.17.1",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "10.9.2"
  },
  "frameworks": [
    {
      "name": "react",
      "version": "19.2.3"
    }
  ],
  "databases": [
    {
      "name": "mysql2",
      "version": "^3.15.3"
    },
    {
      "name": "drizzle",
      "version": "^0.45.1"
    }
  ],
  "betterAuth": {
    "version": "^1.4.7",
    "config": {
      "account": {
        "accountLinking": {
          "enabled": true
        }
      },
      "resetPassword": {
        "enabled": true
      },
      "emailAndPassword": {
        "enabled": true,
        "requireEmailVerification": true
      },
      "emailVerification": {},
      "socialProviders": {
        "google": {},
        "facebook": {},
        "twitter": {}
      },
      "plugins": [
        {
          "name": "admin",
          "config": {
            "id": "admin",
            "hooks": {
              "after": [
                {}
              ]
            },
            "endpoints": {},
            "$ERROR_CODES": {
              "FAILED_TO_CREATE_USER": "Failed to create user",
              "USER_ALREADY_EXISTS": "User already exists.",
              "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL": "User already exists. Use another email.",
              "YOU_CANNOT_BAN_YOURSELF": "You cannot ban yourself",
              "YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE": "You are not allowed to change users role",
              "YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS": "You are not allowed to create users",
              "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS": "You are not allowed to list users",
              "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS": "You are not allowed to list users sessions",
              "YOU_ARE_NOT_ALLOWED_TO_BAN_USERS": "You are not allowed to ban users",
              "YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS": "You are not allowed to impersonate users",
              "YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS": "You are not allowed to revoke users sessions",
              "YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS": "You are not allowed to delete users",
              "YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD": "[REDACTED]",
              "BANNED_USER": "You have been banned from this application",
              "YOU_ARE_NOT_ALLOWED_TO_GET_USER": "You are not allowed to get user",
              "NO_DATA_TO_UPDATE": "No data to update",
              "YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS": "You are not allowed to update users",
              "YOU_CANNOT_REMOVE_YOURSELF": "You cannot remove yourself",
              "YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE": "You are not allowed to set a non-existent role value",
              "YOU_CANNOT_IMPERSONATE_ADMINS": "You cannot impersonate admins",
              "INVALID_ROLE_TYPE": "Invalid role type"
            },
            "schema": {
              "user": {
                "fields": {
                  "role": {
                    "type": "string",
                    "required": false,
                    "input": false
                  },
                  "banned": {
                    "type": "boolean",
                    "defaultValue": false,
                    "required": false,
                    "input": false
                  },
                  "banReason": {
                    "type": "string",
                    "required": false,
                    "input": false
                  },
                  "banExpires": {
                    "type": "date",
                    "required": false,
                    "input": false
                  }
                }
              },
              "session": {
                "fields": {
                  "impersonatedBy": {
                    "type": "string",
                    "required": false
                  }
                }
              }
            }
          }
        }
      ],
      "advanced": {
        "cookiePrefix": "eectuning"
      },
      "session": {
        "expiresIn": 604800,
        "updateAge": 86400,
        "freshAge": 300,
        "rolling": true,
        "rollingDuration": 300
      }
    }
  }
}

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

Looking at the diff between 1.4.7 and 1.4.6 (what I was using previously) it looks like someone added the following in packages/better-auth/package.json:

{
    // ...
    "drizzle-kit": "^0.31.4",
    "drizzle-orm": "^0.41.0",
    // ...
}

Is there a reason the version was set to an old release? I installed with --force and everything seems to be working locally...but I wanted to check

Originally created by @jonbnewman on GitHub (Dec 15, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6778 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Setup an application using better-auth 1.4.6 2. Install latest drizzle-orm (0.45.1) 3. *(try to)* Upgrade to better-auth 1.4.7 (I use `ncu -u && npm i`) 4. See the following error: ```bash npm error While resolving: better-auth@1.4.7 npm error Found: drizzle-orm@0.45.1 npm error node_modules/drizzle-orm npm error drizzle-orm@"^0.45.1" from the root project npm error npm error Could not resolve dependency: npm error peerOptional drizzle-orm@"^0.41.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"^1.4.7" from the root project npm error better-auth@"^1.4.7" from @better-auth/cli@1.4.7 npm error node_modules/@better-auth/cli npm error @better-auth/cli@"^1.4.7" from the root project npm error npm error Conflicting peer dependency: drizzle-orm@0.41.0 ``` ### Current vs. Expected behavior **CURRENT**: Does not work with latest drizzle-orm **EXPECTED**: I expect better-auth to work with the latest drizzle-orm ### What version of Better Auth are you using? 1.4.7 ### System info ```bash { "system": { "platform": "linux", "arch": "x64", "version": "#1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025", "release": "6.6.87.2-microsoft-standard-WSL2", "cpuCount": 32, "cpuModel": "AMD Ryzen 9 9950X3D 16-Core Processor", "totalMemory": "124.59 GB", "freeMemory": "120.17 GB" }, "node": { "version": "v22.17.1", "env": "development" }, "packageManager": { "name": "npm", "version": "10.9.2" }, "frameworks": [ { "name": "react", "version": "19.2.3" } ], "databases": [ { "name": "mysql2", "version": "^3.15.3" }, { "name": "drizzle", "version": "^0.45.1" } ], "betterAuth": { "version": "^1.4.7", "config": { "account": { "accountLinking": { "enabled": true } }, "resetPassword": { "enabled": true }, "emailAndPassword": { "enabled": true, "requireEmailVerification": true }, "emailVerification": {}, "socialProviders": { "google": {}, "facebook": {}, "twitter": {} }, "plugins": [ { "name": "admin", "config": { "id": "admin", "hooks": { "after": [ {} ] }, "endpoints": {}, "$ERROR_CODES": { "FAILED_TO_CREATE_USER": "Failed to create user", "USER_ALREADY_EXISTS": "User already exists.", "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL": "User already exists. Use another email.", "YOU_CANNOT_BAN_YOURSELF": "You cannot ban yourself", "YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE": "You are not allowed to change users role", "YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS": "You are not allowed to create users", "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS": "You are not allowed to list users", "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS": "You are not allowed to list users sessions", "YOU_ARE_NOT_ALLOWED_TO_BAN_USERS": "You are not allowed to ban users", "YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS": "You are not allowed to impersonate users", "YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS": "You are not allowed to revoke users sessions", "YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS": "You are not allowed to delete users", "YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD": "[REDACTED]", "BANNED_USER": "You have been banned from this application", "YOU_ARE_NOT_ALLOWED_TO_GET_USER": "You are not allowed to get user", "NO_DATA_TO_UPDATE": "No data to update", "YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS": "You are not allowed to update users", "YOU_CANNOT_REMOVE_YOURSELF": "You cannot remove yourself", "YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE": "You are not allowed to set a non-existent role value", "YOU_CANNOT_IMPERSONATE_ADMINS": "You cannot impersonate admins", "INVALID_ROLE_TYPE": "Invalid role type" }, "schema": { "user": { "fields": { "role": { "type": "string", "required": false, "input": false }, "banned": { "type": "boolean", "defaultValue": false, "required": false, "input": false }, "banReason": { "type": "string", "required": false, "input": false }, "banExpires": { "type": "date", "required": false, "input": false } } }, "session": { "fields": { "impersonatedBy": { "type": "string", "required": false } } } } } } ], "advanced": { "cookiePrefix": "eectuning" }, "session": { "expiresIn": 604800, "updateAge": 86400, "freshAge": 300, "rolling": true, "rollingDuration": 300 } } } } ``` ### 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 Looking at the diff between 1.4.7 and 1.4.6 (what I was using previously) it looks like someone added the following in `packages/better-auth/package.json`: ```Javascript { // ... "drizzle-kit": "^0.31.4", "drizzle-orm": "^0.41.0", // ... } ``` Is there a reason the version was set to an old release? I installed with `--force` and everything seems to be working locally...but I wanted to check
GiteaMirror added the locked label 2026-04-15 18:06:56 -05:00
Author
Owner

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

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

The drizzle-orm peer dependency in better-auth 1.4.7 is pinned to ^0.41.0, which causes npm to throw a conflict if you use a newer version like 0.45.1. This constraint is enforced only in package.json and not at runtime—there are no explicit version checks or code paths in the drizzle adapter or CLI that target specific drizzle-orm versions. The version pin appears to be conservative, likely due to lack of automated compatibility testing with newer releases, not because of a known incompatibility. Maintainers are aware of this issue but haven't yet released a version supporting 0.45.x or newer (source).

Using --force or --legacy-peer-deps (or pnpm, which is more lenient) will bypass the peer dependency check. Many users report that better-auth works fine with newer drizzle-orm versions when forced, but this setup isn't officially supported or guaranteed. If drizzle-orm introduces breaking changes, you might encounter subtle runtime issues, so it's best to thoroughly test your auth flows and monitor for errors. If you run into problems, consider downgrading drizzle-orm or keeping an eye out for future better-auth releases with expanded support (source).

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:3656265693 --> @dosubot[bot] commented on GitHub (Dec 15, 2025): <!-- Greeting --> Hi @jonbnewman! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> The drizzle-orm peer dependency in better-auth 1.4.7 is pinned to ^0.41.0, which causes npm to throw a conflict if you use a newer version like 0.45.1. This constraint is enforced only in package.json and not at runtime—there are no explicit version checks or code paths in the drizzle adapter or CLI that target specific drizzle-orm versions. The version pin appears to be conservative, likely due to lack of automated compatibility testing with newer releases, not because of a known incompatibility. Maintainers are aware of this issue but haven't yet released a version supporting 0.45.x or newer ([source](https://github.com/better-auth/better-auth/issues/6765)). Using --force or --legacy-peer-deps (or pnpm, which is more lenient) will bypass the peer dependency check. Many users report that better-auth works fine with newer drizzle-orm versions when forced, but this setup isn't officially supported or guaranteed. If drizzle-orm introduces breaking changes, you might encounter subtle runtime issues, so it's best to thoroughly test your auth flows and monitor for errors. If you run into problems, consider downgrading drizzle-orm or keeping an eye out for future better-auth releases with expanded support ([source](https://github.com/better-auth/better-auth/issues/6765)). <!-- 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/5b5749a9-ab5a-48d4-92a4-4334658d823f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5b5749a9-ab5a-48d4-92a4-4334658d823f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5b5749a9-ab5a-48d4-92a4-4334658d823f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5b5749a9-ab5a-48d4-92a4-4334658d823f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5b5749a9-ab5a-48d4-92a4-4334658d823f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5b5749a9-ab5a-48d4-92a4-4334658d823f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5b5749a9-ab5a-48d4-92a4-4334658d823f?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=The%20drizzle-orm%20peer%20dependency%20in%20better-auth%201.4.7%20is%20pinned%20to%20%5E0.41.0%2C%20which%20causes%20npm%20to%20throw%20a%20conflict%20if%20you%20use%20a%20newer%20version%20like%200.45.1.%20This%20constraint%20is%20enforced%20only%20in%20package.json%20and%20not%20at%20runtime%E2%80%94there%20are%20no%20explicit%20version%20checks%20or%20code%20paths%20in%20the%20drizzle%20adapter%20or%20CLI%20that%20target%20specific%20drizzle-orm%20versions.%20The%20version%20pin%20appears%20to%20be%20conservative%2C%20likely%20due%20to%20lack%20of%20automated%20compatibility%20testing%20with%20newer%20releases%2C%20not%20because%20of%20a%20known%20incompatibility.%20Maintainers%20are%20aware%20of%20this%20issue%20but%20haven%27t%20yet%20released%20a%20version%20supporting%200.45.x%20or%20newer%C2%A0%28%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6765%29%29.%0A%0AUsing%20--force%20or%20--legacy-peer-deps%20%28or%20pnpm%2C%20which%20is%20more%20lenient%29%20will%20bypass%20the%20peer%20dependency%20check.%20Many%20users%20report%20that%20better-auth%20works%20fine%20with%20newer%20drizzle-orm%20versions%20when%20forced%2C%20but%20this%20setup%20isn%27t%20officially%20supported%20or%20guaranteed.%20If%20drizzle-orm%20introduces%20breaking%20changes%2C%20you%20might%20encounter%20subtle%20runtime%20issues%2C%20so%20it%27s%20best%20to%20thoroughly%20test%20your%20auth%20flows%20and%20monitor%20for%20errors.%20If%20you%20run%20into%20problems%2C%20consider%20downgrading%20drizzle-orm%20or%20keeping%20an%20eye%20out%20for%20future%20better-auth%20releases%20with%20expanded%20support%C2%A0%28%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6765%29%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/6778)
Author
Owner

@jonbnewman commented on GitHub (Dec 15, 2025):

Closed because dosubot pointed me to the previous issue lodged for this problem

<!-- gh-comment-id:3656279231 --> @jonbnewman commented on GitHub (Dec 15, 2025): Closed because dosubot pointed me to the previous issue lodged for this problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19257