I have a ‘approve’ function using Web3. It works fine locally, but when I try on the deployed site, I get a “Uncaught (in promise) Error: invalid BigNumber value” error.
My local uses node version 14.5.4, so I tried setting the env variable to that, but that still didn’t work.
Functions use a different variable. You need to set AWS_LAMBDA_JS_RUNTIME to nodejs14.x. That x need not be changed to any number. Just use the value as it is.
About the actual error. What library are you using that’s giving you new BigNumber()? I’m asking so I can try this myself.
I tried what you said, but it still didn’t work. Do I need to redeploy after changing the env? Should I try redeploying and clearing the cache? Should I remove the previous env variable?
I’m unable to get the error as I’m not sure what this line is doing props.sendJustContract.methods.approve(address, amount).send({from: props.account});
I believe that’s the one throwing the error in your case?
May I know how to resolve the issue as I’m facing the same problem. I’m getting an error from bignumber.js on my deployed site whereas locally I am not.