Walletconnect Fails to Authenticate on Localhost

Using the demo code base for the Moralis Walletconnect integration, but doesn’t work (see conditions below): https://github.com/abdulmalik97/moralis-react-authentication

Conditions to recreate: Configure Moralis server to any chain id (I was using ETH mainnet or ‘1’, but issue happens on any chain id). Next, deploy code base of React app on localhost. Once running in browser (Chrome) attempt to sign in by scanning Walletconnect QR code with Trustwallet app on mobile phone (iOS).

Result: Trustwallet connection comes up on mobile, but no signing message after that and localhost React app gets stuck; no successful login, user object empty and no error message in console.

I once got it to work on ETH mainnet, but then never again, on ETH or any other chain after that, using conditions above.

I think that wallet connect doesn’t work in general on local host, you may need at least https for wallet connect to work


Metamask usually works correctly even on localhost. But wallets like Trust Wallet will simply not work if you run them on localhost