Comments (7)
this fix seems to work
from web3.js.
Thanks @nicos99 for opening the issue and sharing your findings.
Could you open an MR for this fix?
Also I encourage you to check with web3.js version 4. As version 1 will be deprecated later.
So, could you, please, check with version 4 and share your findings?
from web3.js.
ok, I'll check with version 4 and open a PR (probably this weekend)
from web3.js.
Then @Muhammad-Altabba it turns out that with version 4.2.2 (from 'https://cdn.jsdelivr.net') there is no problem!
The error object caught is generic (.message
: "Internal JSON-RPC error.") but we have access to the data
sub objet that gives details I was looking for (.data.message
: "err: insufficient funds for gas * price + value: address 0x<HHH...> have <AAA...> want <BBB...> (supplied gas <GGG...>)", the exact message differs slightly between the networks/provider but the structure is identical).
from web3.js.
Congratulations @nicos99 that version 4 worked with your case.
It is hard to fulfill the different specifications of every network (in your case Polygon). But we try our best 😄 .
Since the issue is not present in web3 v4. I will suggest to close this issue. And for those who use web3 v1, we encourage them to upgrade. Does this work for your case?
from web3.js.
Thank you @Muhammad-Altabba. I've partialy switched to web3 v4 for my dApp and it will require more validation so for now I'm still on 1.x with my fix. I think this protects against other bugs of the same kind (because we are in a scope not protetced by a try/catch so we have to check carefully each fields access) so I'm going to open a PR soon. I suggest you can tag this bug "1.x" and close it if the PR is not merged quikly.
from web3.js.
Thanks @nicos99 for your understanding, and many thanks for reporting this and trying to fix it on 1.x.
And for those who encounter this issue they can upgrade to version 4.x.
from web3.js.
Related Issues (20)
- Research Snyk Advisor score to make improvements
- web3.utils.fromWei/web3.utils.toWei bug? HOT 2
- "Wagmi Web3js Adapter" example doesn't work HOT 6
- RPC Error: err: insufficient funds for gas * price + value
- Typescript Compilation Errors with latest web3 HOT 3
- web3modal fix contract laboratory test HOT 1
- Increase testing coverage - web3-utils
- Increase testing coverage - web3-rpc-methods
- Increase testing coverage - web3-core
- catching promise - legacy provider error
- Create a function `revokeAccess` that disconnects any previously connected wallets HOT 1
- Add metamask signing and sending transaction examples to the docs
- `web3.utils.toWei(amount, ether)` fix required when decimals in input are overflown. HOT 2
- AbiError: Parameter decoding error: decoded value is less then minimum for given type HOT 1
- 411
- 'No Response error' from web3_request_manager.js HOT 1
- fromWei and toWei accept int as units
- Format schema with oneOf doesn't work correctly
- E2E Infura Tests update
- create browser tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web3.js.