Description
Current Behavior
I'm encountering following warning when switching accounts using Rabby wallet.
index-323aef78.js:2868 Web3Onboard: Error whilst trying to sync connected accounts: TypeError: Cannot read properties of undefined (reading 'find')
at syncWalletConnectedAccounts (index-323aef78.js:3203:74)
at async Object.next (index-323aef78.js:2864:9)
Token transfers preceding this warning message work as expected. When initiating a token transfer after changing the account (and the warning showing up) however, I'm getting following error, even though the first wallet and first account, fetched by using self.onboard.state.get('wallets').wallets[0]
and self.onboard.state.get('wallets').wallets[0].accounts[0]
match the latest account:
TransactionExecutionError: Invalid parameters were provided to the RPC method.
Double check you have provided the correct parameters.
Request Arguments:
from: [PREVIOUSLY_CONNECTED_ADDRESS_(DID_NOT_UPDATE)]
to: [RECIPIENT_ADDRESS]
data: [0x...]
Details: from should be same as current address
Version: [email protected]
Expected Behavior
I would expect web3onboard to update the connected account where necessary, allowing smart contract interactions with the latest connected account.
Steps To Reproduce
With these packages installed switch account on rabby wallet, using chrome browser.
<script type="importmap"> { "imports": { "@nucypher/taco": "https://ga.jspm.io/npm:@nucypher/[email protected]/dist/es/index.js", "@wagmi/core": "https://ga.jspm.io/npm:@wagmi/[email protected]/dist/esm/exports/index.js", "@web3-onboard/core": "https://ga.jspm.io/npm:@web3-onboard/[email protected]/dist/index.js", "@web3-onboard/injected-wallets": "https://ga.jspm.io/npm:@web3-onboard/[email protected]/dist/index.js", "@web3-onboard/metamask": "https://ga.jspm.io/npm:@web3-onboard/[email protected]/dist/index.js", "@web3-onboard/wagmi": "https://ga.jspm.io/npm:@web3-onboard/[email protected]/dist/index.js", "ethers": "https://ga.jspm.io/npm:[email protected]/lib.esm/index.js" }, "scopes": { "https://ga.jspm.io/": { "#lib.esm/crypto/crypto.js": "https://ga.jspm.io/npm:[email protected]/lib.esm/crypto/crypto-browser.js", "#lib.esm/providers/provider-ipcsocket.js": "https://ga.jspm.io/npm:[email protected]/lib.esm/providers/provider-ipcsocket-browser.js", "#lib.esm/providers/ws.js": "https://ga.jspm.io/npm:[email protected]/lib.esm/providers/ws-browser.js", "#lib.esm/utils/base64.js": "https://ga.jspm.io/npm:[email protected]/lib.esm/utils/base64-browser.js", "#lib.esm/utils/geturl.js": "https://ga.jspm.io/npm:[email protected]/lib.esm/utils/geturl-browser.js", "#lib.esm/wordlists/wordlists.js": "https://ga.jspm.io/npm:[email protected]/lib.esm/wordlists/wordlists-browser.js", "#lib/adapters/http.js": "https://ga.jspm.io/npm:[email protected]/lib/helpers/null.js", "#lib/platform/node/classes/FormData.js": "https://ga.jspm.io/npm:[email protected]/lib/helpers/null.js", "#lib/platform/node/index.js": "https://ga.jspm.io/npm:[email protected]/lib/platform/browser/index.js", "#util.inspect.js": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/@empty.js", "@adraffy/ens-normalize": "https://ga.jspm.io/npm:@adraffy/[email protected]/dist/index.mjs", "@ethersproject/abi": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/abstract-provider": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/abstract-signer": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/address": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/base64": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/basex": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/bignumber": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/bytes": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/constants": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/contracts": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/hash": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/hdnode": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/json-wallets": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/keccak256": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib/index.js", "@ethersproject/logger": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/networks": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/pbkdf2": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/properties": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/providers": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/random": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/rlp": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/sha2": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/signing-key": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/solidity": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/strings": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/transactions": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/units": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/wallet": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/web": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@ethersproject/wordlists": "https://ga.jspm.io/npm:@ethersproject/[email protected]/lib.esm/index.js", "@formatjs/fast-memoize": "https://ga.jspm.io/npm:@formatjs/[email protected]/lib/index.js", "@formatjs/icu-messageformat-parser": "https://ga.jspm.io/npm:@formatjs/[email protected]/lib/index.js", "@formatjs/icu-skeleton-parser": "https://ga.jspm.io/npm:@formatjs/[email protected]/lib/index.js", "@metamask/sdk": "https://ga.jspm.io/npm:@metamask/[email protected]/dist/browser/umd/metamask-sdk.js", "@noble/curves/abstract/utils": "https://ga.jspm.io/npm:@noble/[email protected]/esm/abstract/utils.js", "@noble/curves/secp256k1": "https://ga.jspm.io/npm:@noble/[email protected]/esm/secp256k1.js", "@noble/hashes/crypto": "https://ga.jspm.io/npm:@noble/[email protected]/esm/crypto.js", "@noble/hashes/hmac": "https://ga.jspm.io/npm:@noble/[email protected]/esm/hmac.js", "@noble/hashes/pbkdf2": "https://ga.jspm.io/npm:@noble/[email protected]/esm/pbkdf2.js", "@noble/hashes/ripemd160": "https://ga.jspm.io/npm:@noble/[email protected]/esm/ripemd160.js", "@noble/hashes/scrypt": "https://ga.jspm.io/npm:@noble/[email protected]/esm/scrypt.js", "@noble/hashes/sha256": "https://ga.jspm.io/npm:@noble/[email protected]/esm/sha256.js", "@noble/hashes/sha3": "https://ga.jspm.io/npm:@noble/[email protected]/esm/sha3.js", "@noble/hashes/sha512": "https://ga.jspm.io/npm:@noble/[email protected]/esm/sha512.js", "@noble/hashes/utils": "https://ga.jspm.io/npm:@noble/[email protected]/esm/utils.js", "@nucypher/nucypher-contracts": "https://ga.jspm.io/npm:@nucypher/[email protected]/dist/src/index.js", "@nucypher/nucypher-core": "https://ga.jspm.io/npm:@nucypher/[email protected]/dist/es/index_fat.js", "@nucypher/shared": "https://ga.jspm.io/npm:@nucypher/[email protected]/dist/es/index.js", "@web3-onboard/common": "https://ga.jspm.io/npm:@web3-onboard/[email protected]/dist/index.js", "abitype": "https://ga.jspm.io/npm:[email protected]/dist/esm/exports/index.js", "aes-js": "https://ga.jspm.io/npm:[email protected]/lib.esm/index.js", "array-buffer-byte-length": "https://ga.jspm.io/npm:[email protected]/index.js", "available-typed-arrays": "https://ga.jspm.io/npm:[email protected]/index.js", "axios": "https://ga.jspm.io/npm:[email protected]/index.js", "bech32": "https://ga.jspm.io/npm:[email protected]/index.js", "bn.js": "https://ga.jspm.io/npm:[email protected]/lib/bn.js", "bnc-sdk": "https://ga.jspm.io/npm:[email protected]/dist/esm/index.js", "bowser": "https://ga.jspm.io/npm:[email protected]/es5.js", "buffer": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/buffer.js", "call-bind": "https://ga.jspm.io/npm:[email protected]/index.js", "call-bind/callBound": "https://ga.jspm.io/npm:[email protected]/callBound.js", "crypto-es": "https://ga.jspm.io/npm:[email protected]/lib/index.js", "deep-equal": "https://ga.jspm.io/npm:[email protected]/index.js", "deepmerge": "https://ga.jspm.io/npm:[email protected]/dist/cjs.js", "define-data-property": "https://ga.jspm.io/npm:[email protected]/index.js", "define-properties": "https://ga.jspm.io/npm:[email protected]/index.js", "es-define-property": "https://ga.jspm.io/npm:[email protected]/index.js", "es-errors": "https://ga.jspm.io/npm:[email protected]/index.js", "es-errors/eval": "https://ga.jspm.io/npm:[email protected]/eval.js", "es-errors/range": "https://ga.jspm.io/npm:[email protected]/range.js", "es-errors/ref": "https://ga.jspm.io/npm:[email protected]/ref.js", "es-errors/syntax": "https://ga.jspm.io/npm:[email protected]/syntax.js", "es-errors/type": "https://ga.jspm.io/npm:[email protected]/type.js", "es-errors/uri": "https://ga.jspm.io/npm:[email protected]/uri.js", "es-get-iterator": "https://ga.jspm.io/npm:[email protected]/index.js", "ethers": "https://ga.jspm.io/npm:[email protected]/lib.esm/index.js", "ethers/lib/ethers": "https://ga.jspm.io/npm:[email protected]/lib/ethers.js", "ethers/lib/utils": "https://ga.jspm.io/npm:[email protected]/lib/utils.js", "eventemitter3": "https://ga.jspm.io/npm:[email protected]/index.mjs", "for-each": "https://ga.jspm.io/npm:[email protected]/index.js", "function-bind": "https://ga.jspm.io/npm:[email protected]/index.js", "functions-have-names": "https://ga.jspm.io/npm:[email protected]/index.js", "get-intrinsic": "https://ga.jspm.io/npm:[email protected]/index.js", "gopd": "https://ga.jspm.io/npm:[email protected]/index.js", "has-property-descriptors": "https://ga.jspm.io/npm:[email protected]/index.js", "has-proto": "https://ga.jspm.io/npm:[email protected]/index.js", "has-symbols": "https://ga.jspm.io/npm:[email protected]/index.js", "has-symbols/shams": "https://ga.jspm.io/npm:[email protected]/shams.js", "has-tostringtag/shams": "https://ga.jspm.io/npm:[email protected]/shams.js", "hash.js": "https://ga.jspm.io/npm:[email protected]/lib/hash.js", "hasown": "https://ga.jspm.io/npm:[email protected]/index.js", "inherits": "https://ga.jspm.io/npm:[email protected]/inherits_browser.js", "internal-slot": "https://ga.jspm.io/npm:[email protected]/index.js", "intl-messageformat": "https://ga.jspm.io/npm:[email protected]/lib/index.js", "is-arguments": "https://ga.jspm.io/npm:[email protected]/index.js", "is-array-buffer": "https://ga.jspm.io/npm:[email protected]/index.js", "is-bigint": "https://ga.jspm.io/npm:[email protected]/index.js", "is-boolean-object": "https://ga.jspm.io/npm:[email protected]/index.js", "is-callable": "https://ga.jspm.io/npm:[email protected]/index.js", "is-date-object": "https://ga.jspm.io/npm:[email protected]/index.js", "is-map": "https://ga.jspm.io/npm:[email protected]/index.js", "is-number-object": "https://ga.jspm.io/npm:[email protected]/index.js", "is-regex": "https://ga.jspm.io/npm:[email protected]/index.js", "is-set": "https://ga.jspm.io/npm:[email protected]/index.js", "is-shared-array-buffer": "https://ga.jspm.io/npm:[email protected]/index.js", "is-string": "https://ga.jspm.io/npm:[email protected]/index.js", "is-symbol": "https://ga.jspm.io/npm:[email protected]/index.js", "is-weakmap": "https://ga.jspm.io/npm:[email protected]/index.js", "is-weakset": "https://ga.jspm.io/npm:[email protected]/index.js", "isarray": "https://ga.jspm.io/npm:[email protected]/index.js", "isows": "https://ga.jspm.io/npm:[email protected]/_esm/native.js", "joi": "https://ga.jspm.io/npm:[email protected]/dist/joi-browser.min.js", "js-sha3": "https://ga.jspm.io/npm:[email protected]/src/sha3.js", "lodash.defaults": "https://ga.jspm.io/npm:[email protected]/index.js", "lodash.merge": "https://ga.jspm.io/npm:[email protected]/index.js", "lodash.partition": "https://ga.jspm.io/npm:[email protected]/index.js", "lodash.uniqby": "https://ga.jspm.io/npm:[email protected]/index.js", "minimalistic-assert": "https://ga.jspm.io/npm:[email protected]/index.js", "mipd": "https://ga.jspm.io/npm:[email protected]/dist/esm/index.js", "nanoid": "https://ga.jspm.io/npm:[email protected]/index.browser.js", "object-inspect": "https://ga.jspm.io/npm:[email protected]/index.js", "object-is": "https://ga.jspm.io/npm:[email protected]/index.js", "object-keys": "https://ga.jspm.io/npm:[email protected]/index.js", "object.assign": "https://ga.jspm.io/npm:[email protected]/index.js", "possible-typed-array-names": "https://ga.jspm.io/npm:[email protected]/index.js", "process": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/process.js", "qs": "https://ga.jspm.io/npm:[email protected]/lib/index.js", "regexp.prototype.flags": "https://ga.jspm.io/npm:[email protected]/index.js", "rxjs": "https://ga.jspm.io/npm:[email protected]/dist/esm5/index.js", "rxjs/operators": "https://ga.jspm.io/npm:[email protected]/dist/esm5/operators/index.js", "scrypt-js": "https://ga.jspm.io/npm:[email protected]/scrypt.js", "semver": "https://ga.jspm.io/npm:[email protected]/index.js", "set-function-length": "https://ga.jspm.io/npm:[email protected]/index.js", "set-function-name": "https://ga.jspm.io/npm:[email protected]/index.js", "side-channel": "https://ga.jspm.io/npm:[email protected]/index.js", "stop-iteration-iterator": "https://ga.jspm.io/npm:[email protected]/index.js", "sturdy-websocket": "https://ga.jspm.io/npm:[email protected]/dist/index.js", "svelte-i18n": "https://ga.jspm.io/npm:[email protected]/dist/runtime.esm.js", "svelte/store": "https://ga.jspm.io/npm:[email protected]/store/index.mjs", "tslib": "https://ga.jspm.io/npm:[email protected]/tslib.es6.mjs", "viem": "https://ga.jspm.io/npm:[email protected]/_esm/index.js", "viem/actions": "https://ga.jspm.io/npm:[email protected]/_esm/actions/index.js", "viem/chains": "https://ga.jspm.io/npm:[email protected]/_esm/chains/index.js", "viem/utils": "https://ga.jspm.io/npm:[email protected]/_esm/utils/index.js", "which-boxed-primitive": "https://ga.jspm.io/npm:[email protected]/index.js", "which-collection": "https://ga.jspm.io/npm:[email protected]/index.js", "which-typed-array": "https://ga.jspm.io/npm:[email protected]/index.js", "zod": "https://ga.jspm.io/npm:[email protected]/lib/index.mjs", "zustand/middleware": "https://ga.jspm.io/npm:[email protected]/esm/middleware.mjs", "zustand/vanilla": "https://ga.jspm.io/npm:[email protected]/esm/vanilla.mjs" }, "https://ga.jspm.io/npm:@ethersproject/[email protected]/": { "aes-js": "https://ga.jspm.io/npm:[email protected]/index.js" }, "https://ga.jspm.io/npm:@web3-onboard/[email protected]/": { "eventemitter3": "https://ga.jspm.io/npm:[email protected]/index.js" }, "https://ga.jspm.io/npm:@web3-onboard/[email protected]/": { "eventemitter3": "https://ga.jspm.io/npm:[email protected]/index.js" }, "https://ga.jspm.io/npm:[email protected]/": { "nanoid": "https://ga.jspm.io/npm:[email protected]/index.browser.js", "rxjs": "https://ga.jspm.io/npm:[email protected]/index.js" } } } </script> <script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>What package is effected by this issue?
@web3-onboard/core
Is this a build or a runtime issue?
Runtime
Package Version
@web3-onboard/[email protected]
Node Version
No response
What browsers are you seeing the problem on?
Chrome
Relevant log output
index-323aef78.js:2868 Web3Onboard: Error whilst trying to sync connected accounts: TypeError: Cannot read properties of undefined (reading 'find')
at syncWalletConnectedAccounts (index-323aef78.js:3203:74)
at async Object.next (index-323aef78.js:2864:9)
Anything else?
No response
Sanity Check
- If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.