[GH-ISSUE #7739] [Expo][Android] Error: Uncaught (in promise, id: 0) Error: "expo-web-browser" is not installed as a dependency! #10889

Closed
opened 2026-04-13 07:16:03 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @AdiMarianMutu on GitHub (Feb 1, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7739

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Just follow the steps from the official docs: https://www.better-auth.com/docs/integrations/expo

Current vs. Expected behavior

It should not throw the Error: Uncaught (in promise, id: 0) Error: "expo-web-browser" is not installed as a dependency! error

What version of Better Auth are you using?

1.4.18

System info

- NX Monorepo
- @better-auth/expo v1.4.18
- expo v54.0.32

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

Client

Auth config (if applicable)

import { createAuthClient } from 'better-auth/client';

export const authClient = createAuthClient({
  baseURL: `${SharedConstants.Common.AppHttpUriProtocol}${SharedConstants.Common.ServerUrl}`,
  basePath: `${SharedConstants.Common.ServerApiPrefix}/auth`,
  plugins: [
    expoClient({
      scheme: 'myapp',
      storagePrefix: 'myapp',
      storage: SecureStore,
    }),
  ],
});

Additional context

No response

Originally created by @AdiMarianMutu on GitHub (Feb 1, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7739 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Just follow the steps from the official docs: https://www.better-auth.com/docs/integrations/expo ### Current vs. Expected behavior It should not throw the `Error: Uncaught (in promise, id: 0) Error: "expo-web-browser" is not installed as a dependency!` error ### What version of Better Auth are you using? 1.4.18 ### System info ```bash - NX Monorepo - @better-auth/expo v1.4.18 - expo v54.0.32 ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript import { createAuthClient } from 'better-auth/client'; export const authClient = createAuthClient({ baseURL: `${SharedConstants.Common.AppHttpUriProtocol}${SharedConstants.Common.ServerUrl}`, basePath: `${SharedConstants.Common.ServerApiPrefix}/auth`, plugins: [ expoClient({ scheme: 'myapp', storagePrefix: 'myapp', storage: SecureStore, }), ], }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 07:16:03 -05:00
Author
Owner

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

It looks like you're encountering an error regarding the missing expo-web-browser dependency while using Better Auth with Expo SDK 54. This is a common issue related to the need for specific Expo dependencies.

To resolve this, ensure that you have included expo-web-browser in your project's dependencies. You can install it by running:

npm install expo-web-browser

Additionally, make sure you have properly installed the necessary dependencies for Better Auth and the Expo plugin. Here's a reminder of what to include:

npm install better-auth @better-auth/expo expo-network expo-linking expo-secure-store

If you're still facing issues after ensuring all necessary packages are installed, it may help to check your project's configuration and ensure everything aligns with the integration documentation for Expo and Better Auth [1], [8].

Do you have other questions or need assistance with something else related to Better Auth?

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

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3829891855 --> @better-auth-agent[bot] commented on GitHub (Feb 1, 2026): It looks like you're encountering an error regarding the missing `expo-web-browser` dependency while using Better Auth with Expo SDK 54. This is a common issue related to the need for specific Expo dependencies. To resolve this, ensure that you have included `expo-web-browser` in your project's dependencies. You can install it by running: ```bash npm install expo-web-browser ``` Additionally, make sure you have properly installed the necessary dependencies for Better Auth and the Expo plugin. Here's a reminder of what to include: ```bash npm install better-auth @better-auth/expo expo-network expo-linking expo-secure-store ``` If you're still facing issues after ensuring all necessary packages are installed, it may help to check your project's configuration and ensure everything aligns with the integration documentation for Expo and Better Auth [[1]](https://github.com/better-auth/better-auth/pull/6437), [[8]](https://www.better-auth.com/docs/integrations/expo). Do you have other questions or need assistance with something else related to Better Auth? _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

@AdiMarianMutu commented on GitHub (Feb 1, 2026):

Forgot to mention the expo deps I've installed:

"expo": "54.0.32",
"expo-constants": "18.0.13",
"expo-linking": "8.0.11",
"expo-network": "8.0.8",
"expo-router": "6.0.22",
"expo-secure-store": "15.0.8",
"expo-splash-screen": "31.0.13",
"expo-status-bar": "3.0.9",
"expo-system-ui": "6.0.9",
"expo-web-browser": "15.0.10",
<!-- gh-comment-id:3829901327 --> @AdiMarianMutu commented on GitHub (Feb 1, 2026): Forgot to mention the `expo` deps I've installed: ```json "expo": "54.0.32", "expo-constants": "18.0.13", "expo-linking": "8.0.11", "expo-network": "8.0.8", "expo-router": "6.0.22", "expo-secure-store": "15.0.8", "expo-splash-screen": "31.0.13", "expo-status-bar": "3.0.9", "expo-system-ui": "6.0.9", "expo-web-browser": "15.0.10", ```
Author
Owner

@AdiMarianMutu commented on GitHub (Feb 1, 2026):

A temporary workaround is to monkey patch at: https://github.com/better-auth/better-auth/blob/canary/packages/expo/src/client.ts#L361

let Browser: typeof import("expo-web-browser") | undefined =
	undefined;
try {
	Browser = await import("expo-web-browser");
} catch (error) {
	throw new Error(
		'"expo-web-browser" is not installed as a dependency!',
		{
			cause: error,
		},
	);
}

with

const Browser = require("expo-web-browser");
<!-- gh-comment-id:3829917264 --> @AdiMarianMutu commented on GitHub (Feb 1, 2026): A temporary workaround is to monkey patch at: https://github.com/better-auth/better-auth/blob/canary/packages/expo/src/client.ts#L361 ```ts let Browser: typeof import("expo-web-browser") | undefined = undefined; try { Browser = await import("expo-web-browser"); } catch (error) { throw new Error( '"expo-web-browser" is not installed as a dependency!', { cause: error, }, ); } ``` with ```ts const Browser = require("expo-web-browser"); ```
Author
Owner

@AdiMarianMutu commented on GitHub (Feb 1, 2026):

Actually a proper fix should look like this:

let Browser: typeof import("expo-web-browser") | undefined;

try {
  Browser = await import("expo-web-browser");
} catch {
  try {
    Browser = require("expo-web-browser");
  } catch (error) {
    throw new Error('"expo-web-browser" is not installed as a dependency!', { cause: error });
  }
}
<!-- gh-comment-id:3830928519 --> @AdiMarianMutu commented on GitHub (Feb 1, 2026): Actually a proper fix should look like this: ```ts let Browser: typeof import("expo-web-browser") | undefined; try { Browser = await import("expo-web-browser"); } catch { try { Browser = require("expo-web-browser"); } catch (error) { throw new Error('"expo-web-browser" is not installed as a dependency!', { cause: error }); } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10889