Skip to content

signInWithPassword broken in 2.71.0 on React Native (ReferenceError: Property 'structuredClone' doesn't exist) #1615

@samzmann

Description

@samzmann

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

In React Native, calling supabase.auth.signInWithPassword throws an unhandled error ReferenceError: Property 'structuredClone' doesn't exist:

 try {
    const { data, error } = await supabase.auth.signInWithPassword({ email, password })
    console.log('signInWithPassword data', data)
    console.log('signInWithPassword error', error)
  } catch (error) {
    console.log('error', error) // ReferenceError: Property 'structuredClone' doesn't exist
  }

Reverting to @supabase/supabase-js 2.50.3 which depends on @supabase/auth-js 2.70.0 solves the issue.

I also tried installing the @ungap/structured-clone polyfill, but that did not work.

To Reproduce

  1. Setup a basic RN Expo project
  2. Install @supabase/supabase-js 2.51.0
  3. basic Supabase client setup
  4. call supabase.auth.signInWithPassword wrapping it in a try/catch
  5. get the error

Expected behavior

  • if success: return session data (login)
  • if error: return error param

After experiencing this issue, I was surprised to see that signInWithPassword throws if it encounters an unexpected error. This makes the error filed on the response kind of misleading, although I can understand the rational.

System information

  • OS: macOS
  • react-native: 0.79.5
  • expo: ~53.0.17
  • Version of supabase-js: 2.51.0
  • Version of Node.js: 24.3.0

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auth-jsRelated to the auth-js library.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions