eth-sig-util icon indicating copy to clipboard operation
eth-sig-util copied to clipboard

Production build error: Can't convert a BigInt value to a number

Open djimenezdev opened this issue 1 year ago • 4 comments

Hey everyone! So I am using this library to generate the signature for a meta gasless transaction for a mini game I building. And it works perfectly on localhost but when I generate the build folder and use the serve library to run this build folder on a local server I get this Cannot convert a BigInt value to a number error as seen below:

cannotConvert

I also get some warnings when I run the react app using the start command provided by the react-app. I don't know if they have anything to do with it but I'll show a few I am getting below

warnings

Also the react app is built with create-react-app and is using react version ^18.2.0

djimenezdev avatar Apr 01 '23 04:04 djimenezdev

I created a fresh react-app only installing the @metamask/eth-sig-util lib and I simply just import the signTypedData function without even implementing it and I get that exact same error just like in my actual project I am building

djimenezdev avatar Apr 03 '23 17:04 djimenezdev

I've faced the same issue

nenadV91 avatar Apr 13 '23 23:04 nenadV91

Hi

You might want to take a look at:

https://github.com/MetaMask/eth-sig-util/issues/298

to see if pinning to v4.0.1 helps.

keithchew avatar Oct 27 '23 10:10 keithchew

@djimenezdev @nenadV91 Would you be able to try either of v6.0.2 or v7.0.1 and see if the issue persists?

Note that in general, many BigNumber instances are not safe to call toNumber() on since JavaScript number can not fit some values. In particular, users should ensure they aren't using older versions of web3, which are affected by this.

If you are a web3.js user,

legobeat avatar Nov 21 '23 23:11 legobeat