bcnmy / bcnmy/sdk-examples

Social Login Sdk Provider is Null

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
26
Forks
25
PR merge metrics
No merged PRs in 30d

Description

I tried my own and also used : nextjs-biconomy-web3Auth/components/scw.tsx code

but when:

```
const sdk = new SocialLogin();
await sdk.init();
setSocialLoginSDK(sdk);
```

sdk instance was created but in the response of the sdk instance provider is getting null, even after called `await sdk.init();` also getting provider as null.

I can't able to call the **Google Login , Facebook login and Continuew with email options**
when I trigger any of these options, getting error as:

```
WalletLoginError: Failed to connect with walletWallet adapter is not ready yet, Please wait for init function to resolve before calling connect/connectTo function
at Function.fromCode (base.esm.js:375:1)
at Function.connectionError (base.esm.js:381:1)
at OpenloginAdapter.checkConnectionRequirements (base.esm.js:497:1)
at OpenloginAdapter._callee2$ (openloginAdapter.esm.js:163:37)
at tryCatch (regeneratorRuntime.js:44:1)
at Generator.eval (regeneratorRuntime.js:125:1)
at Generator.eval [as next] (regeneratorRuntime.js:69:1)
at asyncGeneratorStep (asyncToGenerator.js:3:1)
at _next (asyncToGenerator.js:22:1)
at eval (asyncToGenerator.js:27:1)
at new Promise ()
at OpenloginAdapter.eval (asyncToGenerator.js:19:1)
at OpenloginAdapter.connect (openloginAdapter.esm.js:195:1)
at Web3AuthCore._callee2$ (core.esm.js:145:1)
at tryCatch (regeneratorRuntime.js:44:1)
at Generator.eval (regeneratorRuntime.js:125:1)
at Generator.eval [as next] (regeneratorRuntime.js:69:1)
at asyncGeneratorStep (asyncToGenerator.js:3:1)
at _next (asyncToGenerator.js:22:1)
at eval (asyncToGenerator.js:27:1)
at new Promise ()
at Web3AuthCore.eval (asyncToGenerator.js:19:1)
at Web3AuthCore.connectTo (core.esm.js:157:1)
at SocialLogin.socialLogin (SocialLogin.js:185:1)
at onClick (UI.js:65:67)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
at executeDispatch (react-dom.development.js:9041:1)
at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1)
at processDispatchQueue (react-dom.development.js:9086:1)
at dispatchEventsForPlugins (react-dom.development.js:9097:1)
at eval (react-dom.development.js:9288:1)
at batchedUpdates$1 (react-dom.development.js:26140:1)
at batchedUpdates (react-dom.development.js:3991:1)
at dispatchEventForPluginEventSystem (react-dom.development.js:9287:1)
at dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay (react-dom.development.js:6465:1)
at dispatchEvent (react-dom.development.js:6457:1)
at dispatchDiscreteEvent (react-dom.development.js:6430:1)
console.error @ client.js:1
window.console.error @ next-dev.js:27
overrideMethod @ react_devtools_backend_compact.js:2367
socialLogin @ SocialLogin.js:201
await in socialLogin (async)
onClick @ UI.js:65
callCallback @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
eval @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26140
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430
```

but when I trigger **Continue using metamask**, again connectWeb3() method is called now I am getting provider in sdk instance, So I can able to logged in and its Smart account also created.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with components/scw.tsx and trace the SocialLogin init path alongside the connectWeb3() path that succeeds. Reproduce the provider-null state and verify completion by confirming Google, Facebook, and email login can connect without the wallet-not-ready error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, typescript
Domain
authentication, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.