walletconnect-monorepo: [React Native] Initializing SignClient failed

Describe the bug On calling Client.init I am getting the following error:

ERROR  {"context": "core"} WebSocket connection failed for URL: wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtwTFhxVHJ0MmlWdW5hVWF0aFltUTJ4bldzSmExVzgyTlBFRVBlR3B0Vk5YSyIsInN1YiI6Ijg5Njk4YWM0ODVkNWZkYmExZGJjZWNhZWYwMjdiMzFlNWNjODVlNGNhNzA0Y2E1ZDhjNjBjZjljMmQ5YjJjNTIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTY2OTQzNDYxMiwiZXhwIjoxNjY5NTIxMDEyfQ.39v1g7cdqct06EAp79bukm1y0dg0VRD6LEQry3_ceXLwnuG3bL_zAneZJpvRlEkArOclqxJjjX3NjjK4__l6BA&projectId=a8ab25078194d16f074b02b55c9fda10&ua=wc-2%2Fjs-2.1.3%2Funknown-%2Freact-native
 ERROR  {"context": "client"} WebSocket connection failed for URL: wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtwTFhxVHJ0MmlWdW5hVWF0aFltUTJ4bldzSmExVzgyTlBFRVBlR3B0Vk5YSyIsInN1YiI6Ijg5Njk4YWM0ODVkNWZkYmExZGJjZWNhZWYwMjdiMzFlNWNjODVlNGNhNzA0Y2E1ZDhjNjBjZjljMmQ5YjJjNTIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTY2OTQzNDYxMiwiZXhwIjoxNjY5NTIxMDEyfQ.39v1g7cdqct06EAp79bukm1y0dg0VRD6LEQry3_ceXLwnuG3bL_zAneZJpvRlEkArOclqxJjjX3NjjK4__l6BA&projectId=a8ab25078194d16f074b02b55c9fda10&ua=wc-2%2Fjs-2.1.3%2Funknown-%2Freact-native

Here is the relevant code that I am using that is throwing the error:

import Client from '@walletconnect/sign-client';

export let signClient: Client;

export async function createSignClient() {
  signClient = await Client.init({
    projectId: '<project_id>',
    metadata: {
      name: 'myapp',
      description: 'myapp',
      url: '#',
      icons: ['https://walletconnect.com/walletconnect-logo.png'],
    },
  });

}

SDK Versions:

"@walletconnect/react-native-compat": "^2.1.4"
"@walletconnect/sign-client": "^2.1.4"
"@walletconnect/types": "^2.1.4"
"react-native": "0.70.3"

• OS: MacOS • React Native

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 20 (7 by maintainers)

Most upvoted comments

Hey there, the latest versions for RN Wallets has been updated on our repos https://github.com/WalletConnect/react-native-examples/pulls

Have been using M1/M2 on my setups. With the setup, is it potentially due to how you have set up the .env file config? @peterferguson @aner87 @RioAU

Hey @crypblizz8, I looked into the setup of the repos you linked and nothing is different when it comes to the env config. In fact, even if I hard code all the env values I still get the websocket failing to connect.

I am also experiencing the same problem with the web3wallet library. Although when I put in some logs it seems to get further than the sign client which only shows the websocket failed to connect error.

Here are some of the logs

[EXPO]  LOG  {"context": "core"} {"context": "core/history"} Initialized
[EXPO]  LOG  {"context": "core"} {"context": "core/expirer"} Initialized
[EXPO]  LOG  {"context": "core"} {"context": "core/relayer"} Initialized
[EXPO]  LOG  {"context": "core"} {"context": "core/relayer"} {"context": "core/relayer/messages"} Initialized
[EXPO]  LOG  {"context": "core"} {"context": "core/relayer"} {"context": "core/relayer/subscription"} Initialized
 DEBUG  {"context": "core"} {"context": "core/relayer"} {"context": "core/relayer/messages"} Successfully Restored records for messages
[EXPO]  LOG  {"context": "core"} {"context": "core/relayer"} {"context": "core/relayer/messages"} {"method": "restore", "size": 0, "type": "method"}
[EXPO]  WARN  {"context": "core"} Core Initialization Failure at epoch 1676041306082 [Error: WebSocket connection failed for URL: wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmbUxBNVR1TkxNQ25oNWlWb1VpelRBYnUyM1l6QThKd29RV2ZjYjFhVENOUCIsInN1YiI6IjA4MTg4ZWE3ZDYzZmQzMThjZmFmMDc0YWFiYTZkZjI3ODkxZTMzZWYyMDQxYTMzNTE5NDUyMTI5ZjAwNzNjZmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTY3NjA0MTMwNSwiZXhwIjoxNjc2MTI3NzA1fQ.uxFlEmoBP7ZjRR01fGjml3LYgdjgclJPcyf3okXsKHEvWslnuevWwoGrBv9mp2qwAfLBpHl_EYG-f68JGJEYBA&projectId=bd105685123997797d8a8ec8d9e952a6&ua=wc-2%2Fjs-2.2.1%2Funknown-%2Freact-native]
[EXPO]  ERROR  {"context": "core"} WebSocket connection failed for URL: wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmbUxBNVR1TkxNQ25oNWlWb1VpelRBYnUyM1l6QThKd29RV2ZjYjFhVENOUCIsInN1YiI6IjA4MTg4ZWE3ZDYzZmQzMThjZmFmMDc0YWFiYTZkZjI3ODkxZTMzZWYyMDQxYTMzNTE5NDUyMTI5ZjAwNzNjZmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTY3NjA0MTMwNSwiZXhwIjoxNjc2MTI3NzA1fQ.uxFlEmoBP7ZjRR01fGjml3LYgdjgclJPcyf3okXsKHEvWslnuevWwoGrBv9mp2qwAfLBpHl_EYG-f68JGJEYBA&projectId=bd105685123997797d8a8ec8d9e952a6&ua=wc-2%2Fjs-2.2.1%2Funknown-%2Freact-native
[EXPO]  ERROR  {"context": "client"} WebSocket connection failed for URL: wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmbUxBNVR1TkxNQ25oNWlWb1VpelRBYnUyM1l6QThKd29RV2ZjYjFhVENOUCIsInN1YiI6IjA4MTg4ZWE3ZDYzZmQzMThjZmFmMDc0YWFiYTZkZjI3ODkxZTMzZWYyMDQxYTMzNTE5NDUyMTI5ZjAwNzNjZmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTY3NjA0MTMwNSwiZXhwIjoxNjc2MTI3NzA1fQ.uxFlEmoBP7ZjRR01fGjml3LYgdjgclJPcyf3okXsKHEvWslnuevWwoGrBv9mp2qwAfLBpHl_EYG-f68JGJEYBA&projectId=bd105685123997797d8a8ec8d9e952a6&ua=wc-2%2Fjs-2.2.1%2Funknown-%2Freact-native
[EXPO]  INFO  {"context": "core"} Web3Wallet Initialization Failure
[EXPO]  ERROR  {"context": "core"} WebSocket connection failed for URL: wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmbUxBNVR1TkxNQ25oNWlWb1VpelRBYnUyM1l6QThKd29RV2ZjYjFhVENOUCIsInN1YiI6IjA4MTg4ZWE3ZDYzZmQzMThjZmFmMDc0YWFiYTZkZjI3ODkxZTMzZWYyMDQxYTMzNTE5NDUyMTI5ZjAwNzNjZmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTY3NjA0MTMwNSwiZXhwIjoxNjc2MTI3NzA1fQ.uxFlEmoBP7ZjRR01fGjml3LYgdjgclJPcyf3okXsKHEvWslnuevWwoGrBv9mp2qwAfLBpHl_EYG-f68JGJEYBA&projectId=bd105685123997797d8a8ec8d9e952a6&ua=wc-2%2Fjs-2.2.1%2Funknown-%2Freact-native

I am experiencing the same exact problem using @crypblizz8 's version… I am running it on an Apple Silicon (the very first Macbook Pro year 2020 with M1 chip)… could M1 be the reason perhaps? @mobilestar0223 and the others facing this issue, what machine do you own?

I have also noticed that in the WS url generated during the error, there’s an unknown keyword at the end … just something worth point out I believe, might be an indicator.

I’m closing this issue because it has been inactive for a few months.

Please reopen if you still encounter this issue with the latest version 😃

+1 for the above in v2.2.1

Hey there, the latest versions for RN Wallets has been updated on our repos https://github.com/WalletConnect/react-native-examples/pulls

Have been using M1/M2 on my setups. With the setup, is it potentially due to how you have set up the .env file config? @peterferguson @aner87 @RioAU