Magic SDK (@magic-sdk/react-native-expo) fails to open WebView with [email protected] (Expo SDK 53)
When integrating @magic-sdk/react-native-expo (v30.4.1) in an Expo SDK 53 project with development build which comes with [email protected], the Magic authentication WebView does not open when using the Magic SDK's login functionality—on Android. There is no crash, but the expected email login (OTP) or WebView screen is never rendered.
Downgrading react-native-webview to v11.26.0 (as mentioned in the documentation) causes the app to crash immediately on startup. 🧩 Steps to Reproduce Create a new Expo project using SDK 53 with development build (which enforces [email protected]).
Install and configure @magic-sdk/react-native-expo (v30.4.1).
Attempt Magic login on Android using the sample context below.
The authentication WebView never appears (silent fail), and the login cannot proceed.
*Expected behavior When calling magic.auth.loginWithEmailOTP({...}), a Magic authentication WebView (email input for OTP) should be rendered on Android and iOS.
*Actual behavior No WebView appears; nothing happens visually. Authentication cannot proceed. This regression affects Android on Expo SDK 53 with [email protected].
import { MagicService } from "@/lib/magic/magic";
const magic = MagicService.magic;
// Called from your UI when user wants to sign in with Magic link
const signIn = async (credentials: { email: string }) => {
try {
// This should open the Magic email OTP WebView,
// but with react-native-webview v13.x on Expo SDK 53, nothing appears on both Android and iOS.
await magic.auth.loginWithEmailOTP({ email: credentials.email });
// If the WebView triggered, this would fetch user info (but WebView never opens)
const magicResponse = await magic.user.getInfo();
// ...subsequent SIWE or API calls omitted for brevity
} catch (error) {
console.error("Magic sign-in error:", error);
}
};
Updates:
- On react-native-webview v11.26.0, the Android app crashes with the error shown below, while iOS works perfectly. (See image below)
- On react-native-webview v13.13.0, the WebView for OTP sign-in fails to trigger on Android only
@melek-hedhili This is a known issue. [email protected] is breaking the message transport. https://github.com/react-native-webview/react-native-webview/issues/3672
Could you try to use [email protected] instead?
@melek-hedhili This is a known issue. [email protected] is breaking the message transport. react-native-webview/react-native-webview#3672
Could you try to use
[email protected]instead?
I've downgraded react-native-webview to version 13.13.0, but the issue persists — the loginWithEmailOTP still doesn't trigger the WebView for the OTP flow. All versions in the 13.x series exhibit the same problem.
Hi @melek-hedhili ,
I tested this with Expo SDK 53, [email protected], and @magic-sdk/[email protected] but couldn’t reproduce — the OTP WebView opened as expected (see the video - https://drive.google.com/file/d/1__g753E8URVgrwnQhAh2816KlB-8ti2s/view?usp=sharing).
Could you share more environment details and a minimal reproducible demo so we can dig deeper?
Thanks
Hi @melek-hedhili ,
I tested this with Expo SDK 53, [email protected], and @magic-sdk/[email protected] but couldn’t reproduce — the OTP WebView opened as expected (see the video - https://drive.google.com/file/d/1__g753E8URVgrwnQhAh2816KlB-8ti2s/view?usp=sharing).
Could you share more environment details and a minimal reproducible demo so we can dig deeper?
Thanks
I’ve provided more details about this issue. Have you tried testing it on an Android emulator or a physical device?
I'm experiencing a similar issue where invoking loginWithEmailOTP and a valid email results in no error messages or events being fired, and no UI. No try-catches get triggered either. Confusingly, sometimes it does work. With no changes. I can restart my computer or maybe rebuild the entire project, and there's a chance it will work once or a few times before failing.
I also had a similar issue on a bare react native project running "react-native": "0.79.5" on the old architecture. Magic calls to getInfo and loginWithEmailOTP hang indefinitely on older Android versions (e.g. 11 - 14) but work on Android 15 and 16.
When I downgraded react-native-webview to 13.13.0 it resolved my issue. Currently I am using "@magic-sdk/react-native-bare": "^30.4.0". But I'd rather not be pinned to an outdated react-native-webview (13.16.0 also has the same issue).
@Ethella Is there a proper fix for this in newer versions of @magic-sdk/react-native-bare or do we have to wait for react-native-webview to fix this issue on their side?
Hello @melek-hedhili, this issue has been fixed in version 31.0.1 and above.
Could you please give it a try and let me know if you’re still experiencing the problem?