You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The callback function from window.ethereum.on('accountsChanged', callbackFunction) is emitted without errors.
Actual behavior
The callback-function is emitted correctly, but the devTools console throws an error:
Uncaught TypeError: Cannot read property 'subscription' of undefined at t.exports.data (index.js?176c:105) at u (inpage.js:1) at t.exports.a.emit (inpage.js:1) at a.<anonymous> (inpage.js:1) at u (inpage.js:1) at a.emit (inpage.js:1) at inpage.js:1 at l.write [as _write] (inpage.js:1) at b (inpage.js:1) at inpage.js:1
hey @DotCoyote thanks for reporting. i was able to recreate this with a test dapp.
it looks like now that metamask is sending this new event down the pipe (wallet_accountsChanged) the web3.js code is failing in that place since it is not expecting an event without a subscription property. We would just need to add some additional checks in that if statement, which i will open a pr for.
Expected behavior
The callback function from
window.ethereum.on('accountsChanged', callbackFunction)
is emitted without errors.Actual behavior
The callback-function is emitted correctly, but the devTools console throws an error:
Going into
index.js?176c:105
showsand
result
only holdsSteps to reproduce the behavior
window.ethereum.on('accountsChanged', handleAccountsChanged);
Logs
Environment
Node: 14.4.0
npm: 6.14.5
web3.js: 1.2.11
macOS: 10.15.5
Chrome 84.0.4147.89
MetaMask 8.0.5
Chain: trufflesuite/ganache-cli:v6.9.1
The text was updated successfully, but these errors were encountered: