Skip to content

Instantly share code, notes, and snippets.

@j-s
Created February 10, 2026 16:16
Show Gist options
  • Select an option

  • Save j-s/94553153b43521389d0cdb919187bd7a to your computer and use it in GitHub Desktop.

Select an option

Save j-s/94553153b43521389d0cdb919187bd7a to your computer and use it in GitHub Desktop.

Privy SDK 3.13.1 Bug: createWallet crash on OAuth login

Error

TypeError: Cannot destructure property 'onSuccess' of 'd.createWallet' as it is undefined.
    at component (OAuthStatusScreen / EmbeddedWalletOnAccountCreateScreen)

Affected version

@privy-io/react-auth 3.13.0 and 3.13.1

Working version

@privy-io/react-auth 3.12.0

Reproduction

  1. Configure PrivyProvider with embeddedWallets.solana.createOnLogin: 'all-users'
  2. Log in with Google (or any OAuth provider)
  3. App crashes immediately after OAuth redirect

Root cause

In OAuthStatusScreen-C4KNGm-v.mjs, after successful OAuth login, the SDK calls setModalData with createWallet config and then navigates to EmbeddedWalletOnAccountCreateScreen:

// Inside OAuthStatusScreen useEffect, after successful OAuth:
if (shouldProceedToEmbeddedWalletCreationFlow(user, config.embeddedWallets)) {
  let e = setTimeout(() => {
    setModalData({
      createWallet: {
        onSuccess: () => {},
        onFailure: (e) => { console.error(e); logout(); },
        callAuthOnSuccessOnClose: true
      }
    });
    navigate("EmbeddedWalletOnAccountCreateScreen");
  }, delay);
}

The EmbeddedWalletOnAccountCreateScreen component destructures modalData.createWallet on render, but modalData.createWallet is undefined — likely a React state batching race condition where the navigation happens before the modal data state update is committed.

Config that triggers it

<PrivyProvider
  appId="..."
  config={{
    loginMethods: ['email', 'google', 'apple'],
    embeddedWallets: {
      solana: {
        createOnLogin: 'all-users',  // triggers the wallet creation flow
      },
      showWalletUIs: false,
    },
  }}
>

Workaround

Pin to @privy-io/react-auth@3.12.0 until a fix is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment