Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.events.off is not a function (it is undefined) after two minutes #3913

Closed
earthflower opened this issue Nov 13, 2023 · 11 comments
Closed
Labels
type: bug Something isn't working

Comments

@earthflower
Copy link

In react-native this.events.off is not a function (it is undefined) bug is coming randomly and usually after 2 minute after connecting core.pairing.pair.

SDK Version (if relevant)

  • Client: React Native
  • Version
   "@walletconnect/core": "2.10.4",
   "@walletconnect/encoding": "^1.0.2",
   "@walletconnect/jsonrpc-types": "^1.0.3",
   "@walletconnect/react-native-compat": "2.10.4",
   "@walletconnect/utils": "2.10.4",
   "@walletconnect/web3wallet": "^1.9.3", 

To Reproduce
Install a new react native app from wallet connect demo app from wallet connect official repo(https://github.com/WalletConnect/react-native-examples) and wait for two minutes.

Expected behavior
Wallet connect should provide option to retry connection in case of any known error like this

Screenshots
Screenshot 2023-11-13 at 10 36 02 AM

@earthflower earthflower added the type: bug Something isn't working label Nov 13, 2023
@earthflower earthflower changed the title this.events.off is not a function (it is undefined) this.events.off is not a function (it is undefined) after two minutes Nov 13, 2023
@ganchoradkov
Copy link
Member

hey @earthflower are you importing react-native-compat before any other @walletconnect package as per the docs? Its required so all RN polyfills can be applied

@earthflower
Copy link
Author

Yes! I am importing react-native-compat on line 1 of react native expo prebuild application. The wallet connections and sign request are working with demo apps But, the mentioned issue with screenshot comes around 2 minutes after keeping the react native app open.

@ignaciosantise
Copy link
Contributor

Hey @earthflower 👋 i wasn't able to reproduce the issue. Could you provide a public repo with the reproducible issue?

@earthflower
Copy link
Author

Sure. Will get back

@dohooo
Copy link

dohooo commented Nov 22, 2023

Sure. Will get back

The same problem but I just removed this import then everything works well.

Some extra information: I imported the @walletconnect/react-native-compat package to follow the other package's instructions then I can't sign in with any wallet.

@peterpeterparker
Copy link

peterpeterparker commented Dec 6, 2023

I've got the same issue when I connect my local dev environment (SvelteKit application). The issue does not occurs on mainnet.

As a workaround, I dowgraded @walletconnect/web3wallet from 1.9.5 to 1.9.1 to resolve the issue.
Seems that I also face the issue with 1.9.3.

@glitch-txs
Copy link

Hi everyone, please provide a minimal reproducible example so we can test the issue, closing for now for lack of information. Feel free to reopen with a MRE. Thanks!

@peterpeterparker
Copy link

I have provided a minimal sample repo to reproduce the issue and opened a new issue to share my findings: #4064

@shan-c
Copy link

shan-c commented Feb 5, 2024

Hi @earthflower. Im facing the same issue. Did you find any fix or workaround for this ?

@glitch-txs glitch-txs reopened this Feb 5, 2024
@earthflower
Copy link
Author

Still looking for fix for this. I am trying to catch when this.events.off message comes to auto-reconnect. But, I am not able to catch the error using try catch js methods

@niklasnatter
Copy link

Hey everybody, we encountered a similar issue today and summarised how we solved it here: #4064 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants