[PR #4207] [MERGED] fix(expo): fix the inability to dynamically import a dependency #5250

Closed
opened 2026-03-13 12:15:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4207
Author: @fax1ty
Created: 8/24/2025
Status: Merged
Merged: 8/26/2025
Merged by: @himself65

Base: canaryHead: fix/expo-dynamic-import


📝 Commits (2)

  • 73e3e2f fix(expo): fix the inability to dynamically import a dependency
  • 07b341c fix: code

📊 Changes

1 file changed (+12 additions, -1 deletions)

View changed files

📝 packages/expo/src/client.ts (+12 -1)

📄 Description

After upgrading to Expo SDK 54 Beta, I encountered an issue with assembling a JS bundle that linked to the expo-web-browser. The error message indicated that the module could not be found.

image

This statement seems to imply that the Expo Web Browser is optional, but the code clearly indicates that it is mandatory.

P.S. Also may close https://github.com/better-auth/better-auth/issues/2682


Summary by cubic

Fix Expo SDK 54 Beta bundling error by replacing the static import of expo-web-browser with a dynamic import. This prevents “module not found” during bundle assembly and shows a clear error if the dependency is missing.

  • Bug Fixes
    • Lazy-load expo-web-browser with await import(...) inside the auth flow.
    • Throw a descriptive error when expo-web-browser isn’t installed; behavior is unchanged when present.

🔄 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/4207 **Author:** [@fax1ty](https://github.com/fax1ty) **Created:** 8/24/2025 **Status:** ✅ Merged **Merged:** 8/26/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/expo-dynamic-import` --- ### 📝 Commits (2) - [`73e3e2f`](https://github.com/better-auth/better-auth/commit/73e3e2fcea412dc6670399f8139a1821760251b1) fix(expo): fix the inability to dynamically import a dependency - [`07b341c`](https://github.com/better-auth/better-auth/commit/07b341c7f34e40d2303038a1f11591c48988b6ce) fix: code ### 📊 Changes **1 file changed** (+12 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/expo/src/client.ts` (+12 -1) </details> ### 📄 Description After upgrading to Expo SDK 54 Beta, I encountered an issue with assembling a JS bundle that linked to the `expo-web-browser`. The error message indicated that the module could not be found. <img width="1310" height="381" alt="image" src="https://github.com/user-attachments/assets/708faefc-4ea2-41aa-8fbe-6d351c42a2ce" /> This statement seems to imply that the Expo Web Browser is optional, but the code clearly indicates that it is mandatory. P.S. Also may close https://github.com/better-auth/better-auth/issues/2682 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix Expo SDK 54 Beta bundling error by replacing the static import of expo-web-browser with a dynamic import. This prevents “module not found” during bundle assembly and shows a clear error if the dependency is missing. - **Bug Fixes** - Lazy-load expo-web-browser with await import(...) inside the auth flow. - Throw a descriptive error when expo-web-browser isn’t installed; behavior is unchanged when present. <!-- 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-03-13 12:15:40 -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#5250