MetaMask / metamask-extension

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

[Bug]: Adding custom RPC URL results in 'Error: No custom network client was found with the ID' #26072

Open sleepytanya opened 4 months ago

sleepytanya commented 4 months ago

Describe the bug

Adding another RPC URL for the existing chain results in 'Error: No custom network client was found with the ID'. URL is successfully replaced, transactions can be submitted as expected.

Unable to change RPC URL back to https://network*name-mainnet.infura.io, error 'Couldn't fetch chain id':

Screenshot 2024-07-25 at 23 27 59

Error when adding cutom RPC for Polygon:

Screenshot 2024-07-25 at 23 28 51

Bug is present in the latest v12.0.0, on develop and in 12.1.0

Expected behavior

-

Screenshots/Recordings

https://github.com/user-attachments/assets/16389ede-996c-40e1-b19a-166bd302e90d

Screenshot 2024-07-24 at 00 45 59

Steps to reproduce

  1. Go to Setting -> Networks
  2. Add alternative RPC URL for the existing chain

Error messages or log output

No response

Detection stage

In production (default)

Version

v12.0.0

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

Gudahtt commented 3 months ago

I don't think https://avalanche-mainnet.infura.io is a valid URL, the project ID is missing. So "Could not fetch chain ID" is the correct error in that case.

Not sure about that first error though.

salimtb commented 3 months ago

hey @sleepytanya , the URL https://avalanche-mainnet.infura.io is not a valid RPC URL , like @Gudahtt said the project ID is missing. regarding the second Error on polygon , can you pls share the RPC URL used ?

sleepytanya commented 3 months ago

@Gudahtt @salimtb

Here is RPC I used for Polygon https://polygon-mainnet.public.blastapi.io Seems like it happens with different RPC URLs on different chains, not Polygon only.

https://github.com/user-attachments/assets/79103278-b5d8-4508-ac6e-795ef1253e42

Network details showing wrong / incomplete link?

Screenshot 2024-07-26 at 12 04 10

I'm on Arbitrum with the custom RPC, doing nothing, getting these errors non-stop (+floating error message in the Settings):

Screenshot 2024-07-26 at 12 19 28 Screenshot 2024-07-26 at 12 20 28

https://github.com/user-attachments/assets/665a64df-d48e-49cb-a6cb-00a8c2e3e39f

Vitomir2 commented 2 months ago

Hello, community,

I am experiencing also some problems with networks that are not added. I am using the web3onboard and receive the following errors from MetaMask:

image