Why does WalletConnect work in development mode, but not in production mode?

839 Views Asked by At

I'm building a DApp with Moralis provider, Nodejs and Reactjs. When I click the connect button, the Wallet Connect Modal appears. But there is a problem. When in development mode, the buttons are blue and the QR code recognition works. In production mode, the buttons are red and the QR code doesn't work.

This is the code for the WalletConnect button.

const { authenticate, isAuthenticated, logout } = useMoralis();
const login2 = async () => {
    if (!isAuthenticated) {
        await authenticate({ provider: 'walletconnect' })
            .then(function(user) {
                const userAddress = user.attributes.accounts[0];
                console.log('logged in: ' + userAddress);
            })
            .catch(function(error) {
                console.log(error);
            });
    }
};

Here is the image of what is happening.

development mode

production mode

0

There are 0 best solutions below