You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting Apple sign‑in in an Expo app using @supabase/supabase-js@2.51.0, the client throws a runtime ReferenceError: Property 'structuredClone' doesn't exist. This error occurs regardless of JS engine (Hermes or JSC) and blocks native authentication flows that rely on structuredClone.
To Reproduce
In a fresh Expo SDK 53 project, install Supabase JS at v2.51.0:
npm install @supabase/supabase-js@2.51.0
Configure jsEngine to either Hermes or JSC in app.json.
Use this minimal repro code:
import*asAppleAuthenticationfrom'expo-apple-authentication';import{supabase}from'./supabaseClient';exportasyncfunctionsignInWithApple(){try{constcredential=awaitAppleAuthentication.signInAsync({requestedScopes: [AppleAuthentication.AppleAuthenticationScope.FULL_NAME,AppleAuthentication.AppleAuthenticationScope.EMAIL,],});if(!credential.identityToken){thrownewError('No identityToken returned from Apple.');}const{ error,data: { user }}=awaitsupabase.auth.signInWithIdToken({provider: 'apple',token: credential.identityToken,});if(error){console.error('Supabase auth error:',error);}else{console.log('✓ Signed in:',user);}}catch(e: any){if(e.code==='ERR_REQUEST_CANCELED'){console.log('User cancelled Apple sign‑in');}else{console.error(e);}}}
Native sign‑in flows should work without requiring a global structuredClone. The client should either polyfill it on unsupported engines or avoid relying on it entirely. Behavior should match v2.50.5, where Apple sign‑in works under Expo.
Screenshots
n/a — error is shown in Metro/console and app terminates.
System information
Expo SDK: 53 (React Native 0.79.5)
JS Engine: Hermes (also reproduces on JSC)
Version of @supabase/supabase-js: 2.51.0
Version of Node.js: 18.16.0
Library for Apple auth:expo-apple-authentication@7.2.4
Additional context
Downgrading to @supabase/supabase-js@2.50.5 resolves the issue: Apple sign‑in completes successfully under Expo when using v2.50.5.
A fix has been proposed in Expo’s PR [#37503](feat(expo): add structuredClone to native apps expo/expo#37503), which would add a structuredClone polyfill for native apps. That PR is still open, all CI checks are passing, but it’s awaiting at least one approving review and resolution of a few reviewer concerns (stringification logic and transfer semantics) before merge.
Once merged—or if Supabase JS bundles its own fallback—the Apple sign‑in error should be resolved. Let me know if you need further logs, test results under Hermes, or any adjustments to the proposed implementation.
Describe the bug
When attempting Apple sign‑in in an Expo app using
@supabase/supabase-js@2.51.0, the client throws a runtimeReferenceError: Property 'structuredClone' doesn't exist. This error occurs regardless of JS engine (Hermes or JSC) and blocks native authentication flows that rely onstructuredClone.To Reproduce
In a fresh Expo SDK 53 project, install Supabase JS at v2.51.0:
Configure
jsEngineto either Hermes or JSC inapp.json.Use this minimal repro code:
Run the app and attempt Apple sign‑in.
Observe the Metro console error:
The app crashes before completing the flow.
Expected behavior
Native sign‑in flows should work without requiring a global
structuredClone. The client should either polyfill it on unsupported engines or avoid relying on it entirely. Behavior should match v2.50.5, where Apple sign‑in works under Expo.Screenshots
n/a — error is shown in Metro/console and app terminates.
System information
@supabase/supabase-js: 2.51.0expo-apple-authentication@7.2.4Additional context
@supabase/supabase-js@2.50.5resolves the issue: Apple sign‑in completes successfully under Expo when using v2.50.5.structuredClonepolyfill for native apps. That PR is still open, all CI checks are passing, but it’s awaiting at least one approving review and resolution of a few reviewer concerns (stringification logic and transfer semantics) before merge.