walletconnect-monorepo: WebSocket fails to connect when not on localhost
I’m trying to integrate the AuthClient, which connects successfully when the app is opened on localhost. However, when I’m trying to connect when the app is opened from a domain it fails to initiate the websocket to relay.walletconnect.com.
It doesn’t provide any errors. My project has the correct allowed domains specified.
I also tried the example app which gives the same results, it works from localhost but not from a specific domain.
The error in the browser console:
ws.ts:114 WebSocket connection to 'wss://relay.walletconnect.com/?auth=jwt&projectId=project-id&ua=wc-2%2Fjs-2.0.0%2Fwindows10-chrome-107.0.0%2Fbrowser%3Ap3041.office.pack.house' failed:
(anonymous) @ ws.ts:114
register @ ws.ts:112
open @ ws.ts:59
open @ provider.ts:113
connect @ provider.ts:30
init @ index.ts:5
error.ts:66 Uncaught TypeError: Cannot read properties of undefined (reading 'message')
at parseConnectionError (error.ts:66:12)
at WsConnection.parseError (ws.ts:160:12)
at socket.onerror (ws.ts:120:28)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (11 by maintainers)
Resetting the project ID in the admin panel after adding the correct domain worked for me.