MetaMask / metamask-extension

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

[Bug]: clicking on etherscan's "Connect to web3" always fail #24388

Open zhiqiangxu opened 1 week ago

zhiqiangxu commented 1 week ago

Describe the bug

After opening this page and switching to the "Write Contract" tab, I click on the "Connect to web3" button, it instantly reports:

{code: 4902, message: 'Unrecognized chain ID. Try adding the chain using `wallet_addEthereumChain` first.'}

This problem is gone if I do it on mainnet, but I'm sure the sepolia network is already added to the list.

(Maybe it's more proper to fire this issue to etherscan, but it seems etherscan is not open source...)

Expected behavior

"Connect to web3" should work as expected.

Screenshots/Recordings

image

Steps to reproduce

Already described above.

Error messages or log output

No response

Version

11.14.5

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

digiwand commented 1 week ago

Hi @zhiqiangxu, thanks for reporting this issue.

Question: Is this bug still occurring if you manually switch to the Sepholia network in MetaMask before connecting? would you mind providing the RPC network / chain ID you were using at the time of the screenshot?

zhiqiangxu commented 1 week ago

Yes, it's still occurring even if I manually switch to the Sepholia network in MetaMask before connecting.

(Another side problem is that the toggle button for "Show test networks" doesn't work neither.)

This is what shows when I click on the sepolia network:

image

So it seems the network information for sepolia is somehow wrong? I can't manually edit it since it's locked.