-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Error: Number can only safely store up to 53 bits #5761
Comments
Thanks @tpalaz for opening the issue, |
Tested With |
Thanks @tpalaz |
@Muhammad-Altabba is the only solution is change version |
Thanks @ix-hwpark I am able to see the error with this code: const Web3 = require('web3');
const web3 = new Web3('https://polygon-mainnet.infura.io/v3/[INFURA_KEA]')
const ts = web3.eth.getTransactionReceipt('0x8a9df67dd623a50806c9bed399783bccd6234a59c3379696542eae125d115998')
ts.then(console.log); And the error that causes the issue inside web3js is: web3.js/packages/web3-utils/src/utils.js Line 60 in b995b9e
And the error would not come if the line at web3.js/packages/web3-utils/src/utils.js Line 236 in b995b9e
return BigInt(value); . However, more tests need to be performed before updating this 6-year-old line 😄 .
And the only fast solution, that I can think of is that you may move to version 4 if this is possible for you. However, it is still in alpha now. |
Here's how we fixed it as a workaround. It's not clean, but it keeps things moving till you transition to 4.x or it's fixed on 1.x. Use patch-package. Create a folder named
In your
|
Is there an existing issue for this?
Current Behavior
When trying to retreive a block, I am getting the error "Number can only safely store up to 53 bits".
The full call stack:
Expected Behavior
The block should resolve and not error when trying to retreive. The error comes from:
"returnTransactionObjects" parameter on the "getBlock" function.
When set to True, it errors.
When set to False or not defined, it works.
Steps to Reproduce
Web3.js Version
1.8.1
Environment
Anything Else?
No response
The text was updated successfully, but these errors were encountered: