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
Some methods like ethereum.request({ method: "eth_requestAccounts" }) don't require params to be set, so I spent an embarrassing of time trying to find out why one call worked and the other didn't.
Context:
I was trying to figure out why a convenience library was failing and figured that going down a level down to the RPC level might help. I tried the most basic RPC request I could think of (getting block number) when I got this error.
Possible solutions:
One solution might be for the MetaMask to add params: [] when no params are specified.
Another solution might be to add some more error checking to the BaseProvider request method?
The text was updated successfully, but these errors were encountered:
markmiro
changed the title
Better errors when calling BaseProvider.request() w
Better errors when calling BaseProvider.request() without paramsAug 18, 2021
markmiro
changed the title
Better errors when calling BaseProvider.request() without params
Better error message when calling BaseProvider.request() without params?
Aug 18, 2021
Environment:
Brave browser with MetaMask v9.8.4 extension installed. Running code in console
The following fails with a confusing error:
MetaMask - RPC Error: Cannot read property 'length' of undefined
However, this succeeds:
Some methods like
ethereum.request({ method: "eth_requestAccounts" })
don't requireparams
to be set, so I spent an embarrassing of time trying to find out why one call worked and the other didn't.Context:
I was trying to figure out why a convenience library was failing and figured that going down a level down to the RPC level might help. I tried the most basic RPC request I could think of (getting block number) when I got this error.
Possible solutions:
params: []
when no params are specified.request
method?The text was updated successfully, but these errors were encountered: