Wallet connector is not ready yet, Please wait for init function to resolve before calling connect/connectTo

image

Our client id: BPqtX-SHEG3SFvNyBu6dJZw2fKNyHb56l-0PBNTfDbdVTrfMqCJDB6gM5V9dhUhxUnBaKUd8ZfDZ-ZsLweIBMIk

We are using custom auth with JWT.

You can try it here: https://staging.amped.bio/
Sign in and go to “My Wallet” page.

Relevant code:

Thanks for sharing the details and links, John! Here’s a summary of your issue for the support team, along with some initial troubleshooting steps and relevant documentation.


Issue Summary

  • Error Message:
    Wallet connector is not ready yet, Please wait for init function to resolve before calling connect/connectTo

  • SDK Details:

    • SDK: Web3Auth Plug n Play (PnP)
    • Likely SDK Package: @web3auth/modal (based on code and docs referenced)
    • Platform: Web (React, TypeScript)
    • Relevant Links:
    • Screenshot Provided:
      image

Context

  • You are using Web3Auth Plug n Play with custom authentication.
  • The error occurs when accessing the “My Wallet” page after signing in.
  • You referenced the Custom Authentication docs.

Key Details for Support

  • SDK Version: Not specified. (If you can, please share the version of @web3auth/modal from your package.json.)
  • Initialization:
    • The error suggests that web3auth.init() may not have completed before calling connect or connectTo.
  • Integration Type: React (with context/provider pattern for Web3Auth).
  • Custom Auth: Using custom authentication (possibly with JWT or social logins).

Next Steps / Troubleshooting

  1. Ensure Proper Initialization

    • Make sure that await web3auth.init() is fully resolved before any calls to connect or connectTo.
    • If you’re using React context, ensure that your context provider waits for init() before exposing the Web3Auth instance.

    Reference:
    Web3Auth Initialization Docs

  2. Check for Race Conditions

    • If connect is triggered by a UI action, ensure the component is not rendering or calling connect before the provider/context is ready.
  3. Debug Logging

    • Add console logs before and after init() and before connect to confirm the sequence.
  4. SDK Version

    • If possible, please confirm the version of @web3auth/modal you are using, as there may be known issues or fixes in recent releases.

Additional Info Needed (if not already provided)

  • The version of @web3auth/modal from your package.json.
  • (Optional) Any relevant code snippets around Web3Auth initialization and usage, if different from the linked files.

Documentation & Resources


If you can confirm your SDK version and share any relevant initialization code (if different from the repo), that will help the support team reproduce and resolve the issue faster.

Let us know if you have any more details or if you try the above steps and still face the issue!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

How can we ensure that init was waited for if there is no init in the code? We followed the official tutorial, which also doesn’t wait for any init: web3auth-examples/custom-authentication/single-connection/custom-jwt-example at main · Web3Auth/web3auth-examples · GitHub

Can someone please help? The code worked for a day, and now it just keeps giving this error. Without receiving support, unfortunately, we will have to change libraries.

Can you share the code for the checkConnection method that’s throwing the error?
i tried searching through your codebase but wasn’t able to find it, plus your staging domain asks for an email + password login.

That error comes from the library

You can sign in with this demo user:

demo@demo.demo
Demo@123

Then go to My Wallet option on menu and click on connect wallet.

I managed to resolve this issue. It’s not documented anywhere that passwordless email must be enabled to use JWT. And the error displayed in the console doesn’t help at all.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.