[PR #7752] [MERGED] fix(expo): expo-web-browser is not installed as a dependency #15781

Closed
opened 2026-04-13 10:13:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7752
Author: @AdiMarianMutu
Created: 2/1/2026
Status: Merged
Merged: 2/24/2026
Merged by: @himself65

Base: canaryHead: fix/expo/web-browser-dep-not-installed


📝 Commits (2)

  • 81f1b65 fix(expo): "expo-web-browser" is not installed as a dependency! (NX monorepo)
  • d8a6620 fix: type

📊 Changes

1 file changed (+13 additions, -9 deletions)

View changed files

📝 packages/expo/src/client.ts (+13 -9)

📄 Description

Fix: Error: "expo-web-browser" is not installed as a dependency!

Unit Tests

Don't see how this could be unit tested as the expo-web-browser import is mocked.


Summary by cubic

Fixes the false “expo-web-browser is not installed” error by trying require() when the dynamic import fails, and adds non-null assertions around Browser calls. Restores compatibility in Nx monorepos and mixed CJS/ESM setups.

  • Bug Fixes
    • If import("expo-web-browser") fails, fall back to require(); only throw if both fail.
    • Use Browser! for dismissAuthSession and openAuthSessionAsync to prevent undefined access.

Written for commit d8a6620d82. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7752 **Author:** [@AdiMarianMutu](https://github.com/AdiMarianMutu) **Created:** 2/1/2026 **Status:** ✅ Merged **Merged:** 2/24/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/expo/web-browser-dep-not-installed` --- ### 📝 Commits (2) - [`81f1b65`](https://github.com/better-auth/better-auth/commit/81f1b651b1c784e135427c241f7a62059a20df72) fix(expo): "expo-web-browser" is not installed as a dependency! (NX monorepo) - [`d8a6620`](https://github.com/better-auth/better-auth/commit/d8a6620d823fbd3b2556addff48ad2da4e6927e3) fix: type ### 📊 Changes **1 file changed** (+13 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/expo/src/client.ts` (+13 -9) </details> ### 📄 Description Fix: Error: "expo-web-browser" is not installed as a dependency! - Closes #7739 ## Unit Tests Don't see how this could be unit tested as the `expo-web-browser` import is mocked. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the false “expo-web-browser is not installed” error by trying require() when the dynamic import fails, and adds non-null assertions around Browser calls. Restores compatibility in Nx monorepos and mixed CJS/ESM setups. - **Bug Fixes** - If import("expo-web-browser") fails, fall back to require(); only throw if both fail. - Use Browser! for dismissAuthSession and openAuthSessionAsync to prevent undefined access. <sup>Written for commit d8a6620d823fbd3b2556addff48ad2da4e6927e3. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:13:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#15781