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.

Incompatible BigNumber types across versions

See original GitHub issue

hi @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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Feb 27, 2020

@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…

1reaction
ricmoocommented, Feb 2, 2020

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! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Large Number data type - Microsoft Support
The following table summarizes the possible situations you may encounter when using the Large Number data type for different product versions.
Read more >
Documentation - Ethers.js
The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally...
Read more >
Backward incompatible changes - Manual - PHP
If the handler needs to work on both PHP 5 and 7, you should remove the type declaration from the handler, while code...
Read more >
Data types | BigQuery - Google Cloud
This page provides an overview of all Google Standard SQL for BigQuery data types, including information about their value domains. For information on...
Read more >
History - Math.js
Update decimal.js to version 10.4.2 . ... Fix #2450: Add BigNumber to parameter type in math.unit and add TypeScript types for Unit.simplify and...
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