WalletConnect Suddenly Unable to Connect Trust Wallet via PC or Mobile

3.8k Views Asked by At

Hello Stack Overflow Community,

I have implemented WalletConnect in my project and it has been working perfectly until now. However, suddenly today, I'm unable to connect my Trust Wallet using WalletConnect, either through a PC or mobile.

While attempting to connect, I'm encountering a WebSocket connection error that reads as follows:

WebSocket connection to 'wss://b.bridge.walletconnect.org/?env=browser&host=MYPROJECT.com&protocol=wc&version=1' failed.

This is thrown by the following lines:

My project was running smoothly with WalletConnect previously, and I've made no significant changes that could impact its functioning.

For the implementation of WalletConnect in my project, I am using the following libraries:

<script src="https://unpkg.com/web3@latest/dist/web3.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/web3modal"></script>
<script type="text/javascript" src="https://unpkg.com/@walletconnect/web3-provider"></script>

I'm curious if anyone else has experienced this problem and what the possible reasons could be. Could this issue be related to a network problem, a server-side issue, or perhaps an update to the WalletConnect or any of the other libraries I'm using?

Any insights or solutions would be greatly appreciated.

What i want to do?

Given that the WalletConnect was previously functioning correctly in my project, and that no major changes have been made to the codebase, I expected it to continue working as usual. My goal was simply to establish a connection between my Trust Wallet and my web application via WalletConnect, as it had been doing successfully before.

When I noticed the problem, I tried the following:

Checking Internet Connection: I verified that my internet connection was stable and functional.

Checking Firewall/VPN Settings: I ensured there were no restrictions set by a firewall or VPN that could potentially block WebSocket connections.

Checking WebSocket URL: I confirmed that the WebSocket URL I was trying to connect to was correct and reachable.

Testing with Different Browsers and Devices: I attempted to connect through various browsers and both mobile and PC devices to rule out device-specific or browser-specific issues.

Examining Console Logs: I inspected the console logs in my browser's developer tools to understand the error messages.

Despite these efforts, I am still unable to establish a WebSocket connection with WalletConnect. I was expecting these steps to resolve any common issues and restore the functionality of WalletConnect in my project.

I'm currently considering other possibilities, such as an issue with the WalletConnect bridge server or a Cross-Origin Resource Sharing (CORS) issue. Any further assistance would be greatly appreciated.

Thanks in advance!

1

There are 1 best solutions below

0
On

Update the version to 2 in wagmiClient settings:

const wagmiClient = createClient({
  autoConnect: true,
  connectors: w3mConnectors({ version: 2, chains, projectId }),
  provider,
});