[SOLVED] Wallet Connect not working (React)

I implement all from docs but button doesn’t show me qr code and other. In console I get this error.Screenshot 2022-06-20 at 11.21.12|690x128

The error from the screenshot is not related to walletconnect.

If that error is breaking the app, try commenting the line with .get and check the walletconnect login again.

const login = async () => {
    if (!isAuthenticated) {
      await authenticate({
        provider: 'walletconnect',
        chainId: 56,
        signingMessage: 'Log in using FairCG',
        mobileLinks: [
          'rainbow',
          'metamask',
          'argent',
          'trust',
          'imtoken',
          'pillar',
        ],
      })
        .then(function (user) {
          console.log(user!.get('ethAddress'))
        })
        .catch(function (error) {
          console.log(error)
        })
    }

this my code, I commit line with .get, but it’s not still working(((

remove the .then() from the login function and try to get the user and authError using useEffect. I think the authenticate function in react does not return any data.

const { user, authError } = useMoralis();
useEffect(() => {
    if (user) {
      console.log(user.get('ethAddress'));
    }
    if (authError) {
      console.log(authError);
    }
  }, [user, authError]);

ohh, tnx for, now I get error with, I doesn’t have package @walletconnect/web3-provider. But i have, i several times remove and reistall this package?

Try updating the moralis and react-moralis packages to latest.
But, i guess installing @walletconnect/web3-provider should have also solved this error.

Maybe restart the localhost after installing the package.

Not working, the problem is webpack doesn’t include package because I didn’t imort this library. Solution is I add CDN and then wallet connect start working.

May be an issue with your project, installing @walletconnect/web3-provider will get rid of that error when using the latest Moralis SDK version in a fresh project. You don’t need to import it as Moralis will require the WalletConnect library when it needs to.