@better-auth/expo plugin missing expo-web-browser peer dependency for Expo SDK 54 #2182

Closed
opened 2026-03-13 09:32:22 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @darkziah on GitHub (Oct 22, 2025).

Description

When building an Expo app with SDK 54, the @better-auth/expo plugin fails during the eager bundling phase with the following error:

[EAGER_BUNDLE]   215 |               let Browser = void 0;
[EAGER_BUNDLE]   216 |               try {
[EAGER_BUNDLE] > 217 |                 Browser = await import('expo-web-browser');
[EAGER_BUNDLE]       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[EAGER_BUNDLE]   218 |               } catch (error) {
[EAGER_BUNDLE]   219 |               throw new Error(
[EAGER_BUNDLE]   220 |                   '"expo-web-browser" is not installed as a dependency!'

Steps to Reproduce

  1. Create an Expo app with SDK 54
  2. Install @better-auth/expo (currently v1.3.28)
  3. Use the expo() plugin in better-auth configuration
  4. Attempt to build the app

Expected Behavior

The @better-auth/expo plugin should work correctly with Expo SDK 54 without requiring manual dependency management.

Actual Behavior

Build fails with the error shown above because expo-web-browser is not properly declared as a peer dependency in the @better-auth/expo package.

Environment

  • Expo SDK: 54.0.19
  • @better-auth/expo: ^1.3.28
  • better-auth: ^1.3.28
  • expo-web-browser: ~15.0.8 (installed in consuming project)
  • Platform: React Native / Expo

Additional Context

The consuming project has expo-web-browser properly installed and configured in both package.json and app.json (as an Expo plugin). The issue appears to be that the @better-auth/expo package is missing the proper peer dependency declaration for expo-web-browser.

This suggests the package needs to add expo-web-browser as a peer dependency with appropriate version constraints for Expo SDK 54 compatibility.

Workaround

Currently, developers need to manually ensure expo-web-browser is installed, but this shouldn't be necessary as it's a dependency of the expo plugin.

Originally created by @darkziah on GitHub (Oct 22, 2025). ## Description When building an Expo app with SDK 54, the `@better-auth/expo` plugin fails during the eager bundling phase with the following error: ``` [EAGER_BUNDLE] 215 | let Browser = void 0; [EAGER_BUNDLE] 216 | try { [EAGER_BUNDLE] > 217 | Browser = await import('expo-web-browser'); [EAGER_BUNDLE] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [EAGER_BUNDLE] 218 | } catch (error) { [EAGER_BUNDLE] 219 | throw new Error( [EAGER_BUNDLE] 220 | '"expo-web-browser" is not installed as a dependency!' ``` ## Steps to Reproduce 1. Create an Expo app with SDK 54 2. Install `@better-auth/expo` (currently v1.3.28) 3. Use the `expo()` plugin in better-auth configuration 4. Attempt to build the app ## Expected Behavior The `@better-auth/expo` plugin should work correctly with Expo SDK 54 without requiring manual dependency management. ## Actual Behavior Build fails with the error shown above because `expo-web-browser` is not properly declared as a peer dependency in the `@better-auth/expo` package. ## Environment - **Expo SDK:** 54.0.19 - **@better-auth/expo:** ^1.3.28 - **better-auth:** ^1.3.28 - **expo-web-browser:** ~15.0.8 (installed in consuming project) - **Platform:** React Native / Expo ## Additional Context The consuming project has `expo-web-browser` properly installed and configured in both `package.json` and `app.json` (as an Expo plugin). The issue appears to be that the `@better-auth/expo` package is missing the proper peer dependency declaration for `expo-web-browser`. This suggests the package needs to add `expo-web-browser` as a peer dependency with appropriate version constraints for Expo SDK 54 compatibility. ## Workaround Currently, developers need to manually ensure `expo-web-browser` is installed, but this shouldn't be necessary as it's a dependency of the expo plugin.
GiteaMirror added the expo label 2026-03-13 09:32:23 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 22, 2025):

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

The @better-auth/expo package does declare expo-web-browser as a peer dependency in its package.json with the constraint ">=14.0.0", which covers your installed version (~15.0.8) and is compatible with Expo SDK 54. This means the build error is not due to a missing peer dependency declaration in the package itself, but could be related to dependency resolution, lockfile issues, or environment-specific quirks in your project setup. You can see the peerDependencies section here.

Current best practice is to manually ensure expo-web-browser and required crypto polyfills (expo-crypto, expo-standard-web-crypto) are installed and configured in your project, as automatic dependency management is not fully handled by @better-auth/expo yet. If you continue to see this error, try cleaning your node_modules and lockfile, then reinstall dependencies. There are no recent PRs addressing this specific issue, and maintainers recommend manual setup as a workaround for now.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 22, 2025): <!-- Greeting --> Hi @darkziah! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> The @better-auth/expo package does declare expo-web-browser as a peer dependency in its package.json with the constraint ">=14.0.0", which covers your installed version (~15.0.8) and is compatible with Expo SDK 54. This means the build error is not due to a missing peer dependency declaration in the package itself, but could be related to dependency resolution, lockfile issues, or environment-specific quirks in your project setup. You can see the peerDependencies section [here](https://github.com/better-auth/better-auth/blob/fa6ee9d68214c6a51e7253b53f957407b116b0c4/packages/expo/package.json). Current best practice is to manually ensure expo-web-browser and required crypto polyfills (expo-crypto, expo-standard-web-crypto) are installed and configured in your project, as automatic dependency management is not fully handled by @better-auth/expo yet. If you continue to see this error, try cleaning your node_modules and lockfile, then reinstall dependencies. There are no recent PRs addressing this specific issue, and maintainers recommend manual setup as a workaround for now. <!-- 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/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/542f361a-9090-4501-824f-69b9b4c15d80?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&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/5495)
Author
Owner

@txtmode commented on GitHub (Oct 26, 2025):

This also fails in a fresh new install as today

@txtmode commented on GitHub (Oct 26, 2025): This also fails in a fresh new install as today
Author
Owner

@darkziah commented on GitHub (Oct 30, 2025):

This also fails in a fresh new install as today

Using Bun and have added resolutions to pin better-auth to 1.3.27:

{
  "resolutions": {
    "better-auth": "1.3.27",
    "@better-auth/expo": "1.3.27",
    "@better-auth/core": "1.3.27"
  }
}
@darkziah commented on GitHub (Oct 30, 2025): > This also fails in a fresh new install as today Using Bun and have added resolutions to pin better-auth to 1.3.27: ```json { "resolutions": { "better-auth": "1.3.27", "@better-auth/expo": "1.3.27", "@better-auth/core": "1.3.27" } } ```
Author
Owner

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

The error occurs because the expo plugin isn’t declaring expo‑web‑browser as a required peer dependency for Expo SDK 54. In other words, even though you have expo‑web‑browser installed in your project, the plugin fails during the eager bundling phase because it isn’t “aware” of that dependency [1].

To troubleshoot this issue, you can take the following steps:

  1. Ensure that expo‑web‑browser is installed with a compatible version (in your case, ~15.0.8 is correct).
  2. As a workaround until the fix is released, explicitly list expo‑web‑browser as a dependency in your project’s package.json so that the bundler can always find it.
  3. If you’re using Bun or another package manager, consider pinning to a version of better‑auth and @better‑auth/expo (such as 1.3.27) where the dependency configuration might work correctly [2].
  4. Finally, check for an update from the maintainers. There is already a fix that declared missing peer dependencies (including expo‑web‑browser) in a later commit. Upgrading to a release that includes this fix (if available) should resolve the error permanently [2].

If these steps do not resolve the issue, consider reaching out to the maintainers with details of your environment (e.g., using Bun) to help them reproduce and address the problem. Any uncertainty remains regarding support for your package manager, so confirming compatibility with the latest fixed version is recommended.

Let me know if you have any further questions!

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Oct 30, 2025): The error occurs because the expo plugin isn’t declaring expo‑web‑browser as a required peer dependency for Expo SDK 54. In other words, even though you have expo‑web‑browser installed in your project, the plugin fails during the eager bundling phase because it isn’t “aware” of that dependency [[1]](https://github.com/better-auth/better-auth/issues/5495). To troubleshoot this issue, you can take the following steps: 1. Ensure that expo‑web‑browser is installed with a compatible version (in your case, ~15.0.8 is correct). 2. As a workaround until the fix is released, explicitly list expo‑web‑browser as a dependency in your project’s package.json so that the bundler can always find it. 3. If you’re using Bun or another package manager, consider pinning to a version of better‑auth and @better‑auth/expo (such as 1.3.27) where the dependency configuration might work correctly [[2]](https://github.com/better-auth/better-auth/pull/4207). 4. Finally, check for an update from the maintainers. There is already a fix that declared missing peer dependencies (including expo‑web‑browser) in a later commit. Upgrading to a release that includes this fix (if available) should resolve the error permanently [[2]](https://github.com/better-auth/better-auth/pull/4207). If these steps do not resolve the issue, consider reaching out to the maintainers with details of your environment (e.g., using Bun) to help them reproduce and address the problem. Any uncertainty remains regarding support for your package manager, so confirming compatibility with the latest fixed version is recommended. Let me know if you have any further questions! <!-- 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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2182