-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error from doing production optimization - Error: invalid BigNumber value (argument="value" #305
Comments
Looks like the same in #290 |
Try discuss: nuxt/nuxt#9957 |
This is nothing to do with this library. It is to do with web3.js and ethers.js and your confusion about which BigNumber library is being used. ethers.js has its own the BigNumber library, and it looks like your problems are caused by mixing the two. Please stop opening issues or spamming other issues about this and linking here for no good reason. |
It has nothing to with web3 and ethers.js I just confirmed. @MikeMcl |
Sorry to chip-in on a closed thread, but I notice Ethers has a BigNumber API that is NOT |
@shuckster BigNumber cannot mixed with BN.js. Thats all I got. But why it would still work if I have BigNumber.js as class BigNumber instance at the first place? |
You can monkey patch ethers by using this code bignumber-monkeypatch.ts
and then importing it in your hardhat.config.ts with the following line
|
version: 9.0.1
web3.js: 1.6.0
ethers: 5.0.17
@vue/cli-service: 4.5.13
The full package.json
Just call the web3.js the contract method that will take BigNumber or BN as parameters.
compile and optimize into distribution:
npm run nuxtbuild-demo
orvue-cli-service build --name index ./src/main.js
results:
However, there is no problem when the function is called under development mode:
It gives me the same result for
1000
or100000000
or any integers. However, it does not act as error on dev mode.vue-cli-service serve
So the final problem is that it does normal in local development environment but it reports error exceptions in the production environment.
The text was updated successfully, but these errors were encountered: