Okx getBalance causing Cannot convert a BigInt value to a number for npm build
See original GitHub issueOccurs after running npm run build
and using OKx to getBalance. Producing the following:
Uncaught (in promise) TypeError: Cannot convert a BigInt value to a number
at Math.pow (<anonymous>)
at e.value (2.eb030928.chunk.js:2:58127)
at Function.value (2.eb030928.chunk.js:2:60075)
at r.value [as parse_balance] (2.eb030928.chunk.js:2:34003)
at r.value [as parse_trading_balance] (2.eb030928.chunk.js:2:1264692)
at r.value [as parse_balance_by_type] (2.eb030928.chunk.js:2:1264145)
at r.<anonymous> (2.eb030928.chunk.js:2:1265638)
at d (2.eb030928.chunk.js:2:1571787)
at Generator._invoke (2.eb030928.chunk.js:2:1571540)
at Generator.next (2.eb030928.chunk.js:2:1572150)
I am working on a browser extension using react, so I run npm run build
and then load the extension into edge. This error doesn’t occur when using npm start
and also occurs on older versions.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
TypeError: can't convert BigInt to number - MDN Web Docs
The JavaScript exception "can't convert BigInt to number" occurs when an arithmetic operation involves a mix of BigInt and Number values.
Read more >Conversion from 'BigInt' to 'number' is not allowed on react ...
I've developed UI using create-react-app. ... npm run build it's throwing the error `Conversion from 'BigInt' to 'number' is not allowed.
Read more >The Essential Guide To JavaScript's Newest Data Type: BigInt
The BigInt data type aims to enable JavaScript programmers to represent integer values larger than the range supported by the Number data type....
Read more >BigInt in JavaScript - GeeksforGeeks
This has various uses where operations on large numbers are required. Syntax: BigInt( number ) or Appending n to end of an integer...
Read more >Enabling Filecoin interoperability with Cosmos Ecosystem
Sonr is building a light-weight trustless Filecoin bridge to its ... Okx getBalance causing Cannot convert a BigInt value to a number for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems its browser compatibility settings for production. Using the following in package.json resolved it:
Thank you for the assistance.
It’s not really an issue with the CCXT code, it’s more like an issue with how
create-react-app
treats JavaScript’s operators: