TypeError: Cannot destructure property 'onSuccess' of 'd.createWallet' as it is undefined.
at component (OAuthStatusScreen / EmbeddedWalletOnAccountCreateScreen)
@privy-io/react-auth 3.13.0 and 3.13.1
@privy-io/react-auth 3.12.0
- Configure
PrivyProviderwithembeddedWallets.solana.createOnLogin: 'all-users' - Log in with Google (or any OAuth provider)
- App crashes immediately after OAuth redirect
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.
<PrivyProvider
appId="..."
config={{
loginMethods: ['email', 'google', 'apple'],
embeddedWallets: {
solana: {
createOnLogin: 'all-users', // triggers the wallet creation flow
},
showWalletUIs: false,
},
}}
>Pin to @privy-io/react-auth@3.12.0 until a fix is released.