question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve ethers.utils.parseUnits error message

See original GitHub issue

Getting this error: ethers-5.0.umd.min.js:1 Uncaught Error: invalid decimal value (argument="value", value=1, code=INVALID_ARGUMENT, version=bignumber/5.0.5)

in this statement

    value: ethers.utils.parseUnits(amount, "gwei"),
  };```

in amount variable the value is 1

In ethers 4.0 it works.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jeffprestescommented, Oct 8, 2020

Thanks Ric. I believe it’s going to help some Devs.

1reaction
ricmoocommented, Oct 8, 2020

This has been fixed in 5.0.17. If you have any problems, please let me know.

Thanks! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ethers.js - Error: invalid BigNumber string
The problem is that the toString of the number will convert it to a scientific representation which cannot be interpreted by the BigNumber....
Read more >
Error Codes - ethers
This error occurs when a call or transaction is used to interact with the blockchain reverts (via revert , require , et cetera)....
Read more >
How to use the ethers.utils.parseUnits function in ethers - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
ethers js exits with this error=> invalid BigNumber value ...
Any help? Unhandled Rejection (Error): invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.5 ...
Read more >
Documentation - Ethers.js
The main purpose of this is to increase the difficulty as time goes on and ... callStatic.transfer("ricmoo.eth", parseUnits("1.23")); // [Error: call revert ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found