Incompatible BigNumber types across versions
See original GitHub issuehi @ricmoo! first off, thank you for all of your work on the ethers project. I really appreciate how you’ve laid the project out, seems like you’ve thought of everything. it has made it a lot more of a pleasure working with ethereum over the past 1.5 years i’ve been using ethers.
encountered some compile issues when loading up a React project on a new computer. it looks like there is a discrepancy with the BigNumber
type between two different versions of ethers. a dependency is on a slightly older version of ethers.
I’m wondering if this has anything to do with my version of node
, since I didn’t have a problem on my other computer (node 10.16 I think). I quickly looked into the issue the error describes, but I couldn’t find any difference in the Hexable
interface or _hex
properties - looked exactly the same. I didn’t have time to continue digging but I’m happy to contribute a solution if you might be able to point me in the right direction.
For now, downgrading my project to 4.0.28
works.
node 12.14.1
ethers 4.0.42
(my project)ethers 4.0.28
(dependency)
Failed to compile.
Type 'import("/<repo>/node_modules/<dependency>/node_modules/ethers/utils/bignumber").BigNumber' is not assignable to type 'import("/<repo>/node_modules/ethers/utils/bignumber").BigNumber'.
Types have separate declarations of a private property '_hex'. TS2322
104 |
105 | const params = await this.contract.functions.params()
> 106 | this.config.paramA = params.A
| ^
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@julientregoat Oh… That looks wonderful. I will investigate it further and may go through and update lots of the library to use that.
Edit: Ah zut… They require ES6. I was planning to move to WeakMap anyways in the next (v6) of the library; this just means the syntax will be nicer. But for v5, looks like we are stuck with underscore named variables…
I’m going to close this now, as there isn’t really much I can do about it. Please feel free to re-open though, or continue comments (I monitor closed issues), since it may be useful to someone in the future that comes across this issue with the same problem.
Thanks! 😃