-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InfuraProvider throws an Error #868
Comments
@lalexgap can you confirm if you are getting this error on the latest |
@lalexgap Yeah, can you confirm this is still happening? I just tried on Was there maybe a short INFURA hiccup when you tried this? |
Yup here's a repo where I'm able to reproduce it using The project where we originally ran into this is using |
Ah I think I found the culprit. We were importing
When I import
We probably shouldn't be importing from anything but Slightly surprised that one would fail and the other wouldn't. |
I’m surprised that makes a difference, but perhaps it has to do with the bundling? Looks like your app is a React something-something? Maybe it needs the browser version which the ethers package automatically bundles and maybe it isn’t grabbing the browser version from the sub-package? |
(also, what file is that in? I couldn’t find it. I don’t check out and install repos on my computer, so I was trying to figure out how to repo it in a single file) |
Specifically
|
Can you try out 5.0.0-beta.192 and see if you still have any problems? It might be related to a similar URL shim. |
I think this was fixed with changing the call signature to the URL library (the library pulled in by some bundlers mimics the node 6 API), so I'm going to close this now, but if it is still a problem, please re-open. Thanks! :) |
This is the response i get when i want to fetch balance using Infura. Please what is wrong [Unhandled promise rejection: Error: bad response (status=400, headers={"vary":"Origin","content-type":"application/json","date":"Tue, 08 Jun 2021 15:01:22 GMT","content-length":"74"}, body="{"jsonrpc":"2.0","error":{"code":-32600,"message":"invalid json request"}}", requestBody="{"method":"eth_getBalance","params":["0x77ab999d1e9f152156b4411e1f3e2a42dab8cd6d","latest"],"id":42,"jsonrpc":"2.0"}", requestMethod="POST", url="https://mainnet.infura.io/v3/c3db1af154164**************9", code=SERVER_ERROR, version=web/5.3.0)] |
My lines of code const getBalanceAsync = async (address) => { |
I see this all the time with a project built with eth-scaffold.
|
I get same error and same configuration im using nodejs14.x from a serverless lambda |
I managed to resolve this by making sure I bundle with cjs and not esm. Esm was causing me problems. |
I'm attempting to use the
InfuraProvider
to connect to theropsten
network but I get an error when doing so.Doing this
results in the following error:
As a sanity check using I made sure I could access the Infura endpoint with my project id using
curl
which worksNote: Infura project ID is a throw-away that will be deleted once this is resolved :)
The text was updated successfully, but these errors were encountered: