Wallet login giving error after upgrade

Google login works fine, please help us resolve this

  const chainConfig = {
    displayName: "Polygon Mainnet",
    chainNamespace: CHAIN_NAMESPACES.EIP155,
    chainId: "0x89",
    //chainId: "0x13881",
    rpcTarget: process.env.REACT_APP_POLYGON_RPC_URL,
    blockExplorer: "https://polygonscan.com/",
    ticker: "MATIC",
    tickerName: "Matic",
    decimals: 18,
  };

  const web3AuthHandler = async () => {
    const web3AuthInstance = new Web3Auth({
      chainConfig,
      // get your client id from https://dashboard.web3auth.io
      clientId: process.env.REACT_APP_WEB3_AUTH,
    });

    await web3AuthInstance.initModal();
    setWeb3Auth(web3AuthInstance);
  };

 const connectHanlder = async () => {
    try {
      if (web3Auth) {
        const web3authProvider = await web3Auth.connect()
        if (web3authProvider) {
          hotjar.initialize(3306401, 6);
          setIsConnecting(true)
          const web3Provider = new ethers.providers.Web3Provider(web3authProvider);
          //const web3 = new Web3(web3authProvider);
          const signerVal = web3Provider.getSigner();
          const address = await signerVal.getAddress();
          const accountInfo = await web3Auth.getUserInfo();
          const isSocialLogin = Object.keys(accountInfo).length !== 0
          const biconomySmartAccountConfig = {
            signer: signerVal,
            chainId: ChainId.POLYGON_MAINNET,
            bundler: bundler,
            paymaster: paymaster,
            rpcUrl: process.env.REACT_APP_POLYGON_RPC_URL,
          };
          let biconomySmartAccount = new BiconomySmartAccount(
            biconomySmartAccountConfig
          );
          biconomySmartAccount = await biconomySmartAccount.init();
          const scwAddress = await biconomySmartAccount.getSmartAccountAddress()

          setEoaAddress(address?.toLowerCase())
          setSmartAccount(biconomySmartAccount);
          setProvider(web3Provider);
          setSigner(signerVal)
          setIsConnected(true);
          setSocailLogin(isSocialLogin)
          //setWeb3Val(web3);
          isSocialLogin ? setSocialInfo(accountInfo) : setSocialInfo(null)
          if (scwAddress?.length) {
            if (searchParams.get("referralID")?.length) {
              connectWalletAddress(scwAddress, searchParams.get("referralID"), isSocialLogin, accountInfo, address?.toLowerCase(), connectWalletCallBack)
            } else {
              connectWalletAddress(scwAddress, "", isSocialLogin, accountInfo, address?.toLowerCase(), connectWalletCallBack);
            }
          }
          setIsConnecting(false)
          return scwAddress;
        }
      } else return
    } catch (err) {
      setIsConnecting(false)
      //console.log(err, "here")
    }
  };

  useEffect(() => {
    async function init() {
      
      await web3AuthHandler();
    }
    init();
  }, []);

@betnow Welcome Aboard!

Your issue has been forwarded to our Dev team and we will get back with further updates.

1 Like

hey any update on this ?

Hey @betnow, I see the issue you’re encountering. It looks like you might have missed including web3auth.connect() after initModal. This is a common oversight, so no worries! I suggest taking a look at our example in the React Modal Quick Start Guide. It should give you a clearer idea of how to implement this part of the process. And of course, if you have any more questions or need further clarification, feel free to ask. We’re here to help!

hey in the example shared web3auth.connect() is called on button click ,not after initModal

@maharshi ,hey any update on this

Yeah, it’s kept on the click of a button so that connect is fired when everything else loads, on the click of a button. Could you please ensure that you’re not missing that one out?

Yes connect is called on click of button, issue is only for wallet login and google login works fine.
We are facing this issue after upgrading

We’re disappointed to report that despite following the provided guide, a resolution is still pending. This situation is not acceptable

Hey @betnow,
I understand. Please share your walletconnect initialisation snippet. I assume it might be the method connectWalletAddress. Thanks for your patience.

@maharshi hey i have shared it in this thread

I understand, but it doesn’t have something like this. Please review our example and check if you have added the walletconnect v2 adapter parameters. @betnow

@maharshi cloned this and ran it , getting the same error


Thanks for trying that out, @betnow. But I pressed the connect to wallet button. Once logged in via scanning the QR code via the MetaMask mobile app. Then the other time, using MetaMask extension in my browser and lastly via the Torus browser option. Can you please re-create this issue and record a video while doing that? It would be super helpful if you could use some tool like jam.dev but it’s not mandatory.
I tried with some variations in my way of logging in as well but failed to reproduce the error.

hey here is the jam link

@maharshi could you please provide an update? We’re currently unable to proceed with the upgrade, and it’s impacting our users. Your assistance in resolving this matter would be greatly appreciated.

Hey @betnow,

Thank you for reaching out with your issue. I’ve been working to replicate the error you’ve mentioned, but so far, I haven’t encountered it on our end. I’ve tried various approaches, including changing browsers, enabling Brave Shields for localhost, activating an ad blocker, and even using incognito mode, but the error hasn’t appeared in any of these scenarios.

Could I suggest trying to run the cloned example on a different browser? Sometimes, specific browser configurations can lead to unexpected behavior. It’s also worth noting that this issue wasn’t reported in version 7, and we haven’t seen it in version 8 either. We have many clients using WalletConnect as their primary login method, and they haven’t reported this problem.

We’re here to help, and we appreciate your cooperation in resolving this matter.