MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.92k stars 4.88k forks source link

[Bug]: Cannot destructure property 'chainId' #25043

Closed avenbreaks closed 1 month ago

avenbreaks commented 3 months ago

Describe the bug

Adding BNB Testnet BEP20 Network, possibly because the network is full, I tried adding the RPC API URL of other platforms such as Alchemy, Chainstack, Publicnode.

Expected behavior

No response

Screenshots/Recordings

image

image

Steps to reproduce

  1. Add Network
  2. Getting Error logs

Error messages or log output

Message: Cannot destructure property 'chainId' of '(0 , t.useSelector)(...)' as it is undefined.

Code: TypeError

Stack:
TypeError: Cannot destructure property 'chainId' of '(0 , t.useSelector)(...)' as it is undefined.
  at z (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/ui-2.js:1:841315)
  at ga (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:60103)
  at Os (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:104934)
  at Au (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:90842)
  at Cu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:90767)
  at Tu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:88115)
  at yu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:84859)
  at al (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:112490)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:113689
  at xu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:88466)
  at dl (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:113674)
  at render (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:115597)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/ui-5.js:1:314517


### Version

11.16.5

### Build type

None

### Browser

Chrome

### Operating system

MacOS

### Hardware wallet

_No response_

### Additional context

_No response_

### Severity

_No response_
gauthierpetetin commented 3 months ago

Hi @avenbreaks , thanks for reporting this issue. Can you please provide more detail regarding steps to reproduce? When you tried adding RPC API URL of other platforms such as Alchemy, Chainstack, Publicnode, did it fail for every platform or only for some of them?

vandan commented 3 months ago

Please specify all the RPC connection metadata you included in your wallet_addEthereumChain call for "BNB Testnet BEP20 Network"

avenbreaks commented 3 months ago

Hi @avenbreaks , thanks for reporting this issue. Can you please provide more detail regarding steps to reproduce? When you tried adding RPC API URL of other platforms such as Alchemy, Chainstack, Publicnode, did it fail for every platform or only for some of them?

GM, When I add RPC to Metamask and the extension suddenly crashes (cannot be reopened) it brings up a notification like the screenshot above.

for now I really can't open it.

SalaGaInCrypto commented 3 months ago

You were able to fix it? Same problem and nothing works.

KanteLabs commented 3 months ago

Encountering this issue as well

Gudahtt commented 3 months ago

The stack trace points to this line: https://github.com/MetaMask/metamask-extension/blob/c699439fbe523a9214ff58ce7fd681dfc47f9c50/ui/components/app/asset-list/asset-list.js#L58

adonesky1 commented 3 months ago

Could you link what network you're referring to here:

BNB Testnet BEP20 Network

Did you mean to refer to a particular asset on BNB Smart Chain Testnet chainId: 97 (0x61)

StefanVitor commented 2 months ago

Hi,

I have the same issue, do you have a way to fix this (and that solution to not be to re-install extension)?

Gudahtt commented 2 months ago

Bumped to a Sev1 because some users seem unable to workaround without reinstalling

Gudahtt commented 1 month ago

I suspect that this was fixed by https://github.com/MetaMask/metamask-extension/pull/26327, which was included in v12.0.1

Gudahtt commented 1 month ago

Closing as fixed by #26327. No reports so far from v12.0.1.

Everyone in this thread, please update to v12.0.1 and comment here if you notice this problem remains. We can re-open if necessary. If you see a new error, please let us know and open a new issue for it. Thanks!