web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

Metamask widget 9.0.4, provider.off is undefined

Open ochikov opened this issue 4 years ago • 1 comments

Since the update of metamask browser widget -> 9.0.4, there is no .off function when the provider is created using metamask widget. I cannot unsubscribe from the subscribed events.

Using metamask App from IOS, I can still unsubscribe because the .off function is in provider and I can trigger it with event name and callback function.

ochikov avatar Feb 02 '21 16:02 ochikov

I am experiencing the same issue with matamask version 10.11.3.

A workaround is to use the removeListener or the removeAllListeners methods:

provider.removeListener(name, callback);
provider.removeAllListeners(name);

See: https://github.com/MetaMask/metamask-extension/issues/10196

sharvit avatar Mar 29 '22 05:03 sharvit

With stable version 2.0.0 of Web3Modal now released, we are officially dropping support for version 1.x Due to this this issue/pr was marked for closing. It is highly recommended to upgrade as 2.x will be receiving further updates that will enable functionality for some of our newer sdks like auth and push as well as support for WalletConnect v2 (See this post about WalletConnect v1 being deprecated https://medium.com/walletconnect/walletconnect-v1-0-sunset-notice-and-migration-schedule-8af9d3720d2e)

If you need to continue using Web3Modal 1.x and require this feature/fix implemented, we suggest adding it via forking V1 branch.

xzilja avatar Jan 21 '23 14:01 xzilja