[GH-ISSUE #7770] @better-auth/sso fails to resolve "better-call" dependency in 1.4.18 #19529

Closed
opened 2026-04-15 18:45:36 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @robingenz on GitHub (Feb 3, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7770

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Install better-auth@1.4.18 and @better-auth/sso@1.4.18 in a Cloudflare Workers project using wrangler
  2. Run wrangler dev or wrangler deploy
  3. Build fails with error: Could not resolve "better-call"

Current vs. Expected behavior

Current behavior:

Build fails with the following error:

✘ [ERROR] Could not resolve "better-call"

    node_modules/@better-auth/sso/dist/index.mjs:14:39:
      14 │ import { APIError as APIError$1 } from "better-call";
         ╵                                        ~~~~~~~~~~~~~

The @better-auth/sso package imports from better-call, but this dependency is not being resolved by the bundler.

Expected behavior:

The build should complete successfully as it did with version 1.4.17. The better-call dependency should either be bundled with the package or properly declared as a peer/external dependency.

What version of Better Auth are you using?

1.4.18

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.6.0: Wed Nov  5 21:33:58 PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6000",
    "release": "24.6.0",
    "cpuCount": 10,
    "cpuModel": "Apple M1 Pro",
    "totalMemory": "32.00 GB",
    "freeMemory": "0.16 GB"
  },
  "node": {
    "version": "v22.21.1",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "10.9.4"
  },
  "frameworks": [
    {
      "name": "hono",
      "version": "4.6.12"
    }
  ],
  "databases": [
    {
      "name": "postgres",
      "version": "3.4.7"
    },
    {
      "name": "drizzle",
      "version": "0.44.2"
    }
  ],
  "betterAuth": {
    "version": "1.4.18",
    "config": null
  }
}

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

Package

Auth config (if applicable)

// Not applicable - build fails before runtime

Additional context

No response

Originally created by @robingenz on GitHub (Feb 3, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7770 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Install `better-auth@1.4.18` and `@better-auth/sso@1.4.18` in a Cloudflare Workers project using wrangler 2. Run `wrangler dev` or `wrangler deploy` 3. Build fails with error: `Could not resolve "better-call"` ### Current vs. Expected behavior **Current behavior:** Build fails with the following error: ``` ✘ [ERROR] Could not resolve "better-call" node_modules/@better-auth/sso/dist/index.mjs:14:39: 14 │ import { APIError as APIError$1 } from "better-call"; ╵ ~~~~~~~~~~~~~ ``` The `@better-auth/sso` package imports from `better-call`, but this dependency is not being resolved by the bundler. **Expected behavior:** The build should complete successfully as it did with version 1.4.17. The `better-call` dependency should either be bundled with the package or properly declared as a peer/external dependency. ### What version of Better Auth are you using? 1.4.18 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.6.0: Wed Nov 5 21:33:58 PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6000", "release": "24.6.0", "cpuCount": 10, "cpuModel": "Apple M1 Pro", "totalMemory": "32.00 GB", "freeMemory": "0.16 GB" }, "node": { "version": "v22.21.1", "env": "development" }, "packageManager": { "name": "npm", "version": "10.9.4" }, "frameworks": [ { "name": "hono", "version": "4.6.12" } ], "databases": [ { "name": "postgres", "version": "3.4.7" }, { "name": "drizzle", "version": "0.44.2" } ], "betterAuth": { "version": "1.4.18", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript // Not applicable - build fails before runtime ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-15 18:45:36 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Feb 3, 2026):

It seems you're experiencing an issue with the @better-auth/sso package not being able to resolve the better-call dependency when using version 1.4.18. Currently, it appears that there is an open issue discussing this dependency resolution error, and the package might require better-call to be properly declared as a peer or external dependency to avoid such issues during build processes [1].

Next steps you can take include:

  1. Check if any updates or fixes have been released since version 1.4.18.
  2. If the problem persists, you may want to try downgrading to version 1.4.17, where this issue did not occur, to see if that resolves the build failure.

Feel free to tag members of the Better Auth team @bekacru and @ping__ for further assistance. Is there anything specific you'd like to know more about regarding Better Auth or troubleshooting?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3839038358 --> @better-auth-agent[bot] commented on GitHub (Feb 3, 2026): It seems you're experiencing an issue with the `@better-auth/sso` package not being able to resolve the `better-call` dependency when using version 1.4.18. Currently, it appears that there is an open issue discussing this dependency resolution error, and the package might require better-call to be properly declared as a peer or external dependency to avoid such issues during build processes [[1]](https://github.com/better-auth/better-auth/issues/7761). Next steps you can take include: 1. Check if any updates or fixes have been released since version 1.4.18. 2. If the problem persists, you may want to try downgrading to version 1.4.17, where this issue did not occur, to see if that resolves the build failure. Feel free to tag members of the Better Auth team @bekacru and @ping__ for further assistance. Is there anything specific you'd like to know more about regarding Better Auth or troubleshooting? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@dosubot[bot] commented on GitHub (Feb 3, 2026):

The build failure happens because @better-auth/sso@1.4.18 imports from "better-call", but "better-call" is only listed as a devDependency—not as a dependency or peerDependency—so it's missing at runtime in environments like Cloudflare Workers. This causes bundlers to throw a "Could not resolve 'better-call'" error source.

This issue was fixed in a subsequent release: a merged PR added "better-call" as a peer dependency in @better-auth/sso and updated imports to use "APIError" from "better-auth/api" instead source.

To work around this in 1.4.18, manually install "better-call" in your project (npm install better-call) and, if needed, use package manager features like "overrides" or "resolutions" to force the correct version source. Upgrading to the next release after 1.4.18 will resolve the issue without manual steps.

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:3839045889 --> @dosubot[bot] commented on GitHub (Feb 3, 2026): <!-- Answer --> The build failure happens because @better-auth/sso@1.4.18 imports from "better-call", but "better-call" is only listed as a devDependency—not as a dependency or peerDependency—so it's missing at runtime in environments like Cloudflare Workers. This causes bundlers to throw a "Could not resolve 'better-call'" error [source](https://github.com/better-auth/better-auth/blob/583f12fb7db38681ee882d219ce3895faa4a6976/packages/sso/package.json#L63-L84). This issue was fixed in a subsequent release: a merged PR added "better-call" as a peer dependency in @better-auth/sso and updated imports to use "APIError" from "better-auth/api" instead [source](https://github.com/better-auth/better-auth/pull/7676). To work around this in 1.4.18, manually install "better-call" in your project (`npm install better-call`) and, if needed, use package manager features like "overrides" or "resolutions" to force the correct version [source](https://github.com/better-auth/better-auth/issues/7023). Upgrading to the next release after 1.4.18 will resolve the issue without manual steps. <!-- 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/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fd7c533c-1430-4d4e-a7ee-d23479b54cd3?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%20build%20failure%20happens%20because%20%40better-auth/sso%401.4.18%20imports%20from%20%22better-call%22%2C%20but%20%22better-call%22%20is%20only%20listed%20as%20a%20devDependency%E2%80%94not%20as%20a%20dependency%20or%20peerDependency%E2%80%94so%20it%27s%20missing%20at%20runtime%20in%20environments%20like%20Cloudflare%20Workers.%20This%20causes%20bundlers%20to%20throw%20a%20%22Could%20not%20resolve%20%27better-call%27%22%20error%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/blob/583f12fb7db38681ee882d219ce3895faa4a6976/packages/sso/package.json%23L63-L84%29.%0A%0AThis%20issue%20was%20fixed%20in%20a%20subsequent%20release%3A%20a%20merged%20PR%20added%20%22better-call%22%20as%20a%20peer%20dependency%20in%20%40better-auth/sso%20and%20updated%20imports%20to%20use%20%22APIError%22%20from%20%22better-auth/api%22%20instead%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/pull/7676%29.%0A%0ATo%20work%20around%20this%20in%201.4.18%2C%20manually%20install%20%22better-call%22%20in%20your%20project%20%28%60npm%20install%20better-call%60%29%20and%2C%20if%20needed%2C%20use%20package%20manager%20features%20like%20%22overrides%22%20or%20%22resolutions%22%20to%20force%20the%20correct%20version%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/7023%29.%20Upgrading%20to%20the%20next%20release%20after%201.4.18%20will%20resolve%20the%20issue%20without%20manual%20steps.)&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/7770)
Author
Owner

@robingenz commented on GitHub (Feb 3, 2026):

Fixed by #7676

<!-- gh-comment-id:3839084239 --> @robingenz commented on GitHub (Feb 3, 2026): Fixed by #7676
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19529