How to terminate isAuthenticating or isWeb3EnableLoading

using web3auth in react moralis and wonder how to fix this issue where web3auth modal is closed and reopened again, isAuthenticating and isWeb3EnableLoading are still true and below error occurs.

are there any helper functions to terminate these enableWeb3() process?

Error: Cannot execute Moralis.enableWeb3(), as Moralis Moralis.enableWeb3() already has been called, but is not finished yet

cc @DappThatApp @cryptokid

thanks,

1 Like

Were are you calling Moralis.enableWeb3()?

can you try one thing first just for debugging purposes

await authenticate({
                    provider: "web3Auth",
                    clientId: process.env.REACT_APP_WEB3_AUTH_CLIENT_ID,
                    chainId: Moralis.Chains.POLYGON_MUMBAI,
                    onError: (error) => console.log('error :>> ', error),
                    onSuccess: (user) => console.log('user :>> ', user),
                    onComplete: (complete) => console.log('complete :>> ', complete)
                  });

switch out the web3auth provider with the moralis provider just to see if that works. can u let me know the result.

have u tried this video

thanks for the reply and no, but authenticate() does seem to call enableWeb3() behind the scene

thanks for getting back to me @mcgrane5
Yes I followed that tutorial and also changing from web3auth to web3Auth only prompts metamask but not web3auth modal UI

1 Like

Any update on this? I am running into the same error.