Help with following error: 'invalid BigNumber value (argument="value", value="50000000000000000000"...'

Iโ€™m trying to transfer an amount of a BEP20 token (testnet), but I keep getting this error:
*This only happens in production, works perfectly fine on localhost

Error: invalid BigNumber value (argument="value", value="50000000000000000000", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
    at h.makeError (_app-ca0a8f82dab99437.js:1:267207)
    at h.throwError (_app-ca0a8f82dab99437.js:1:267327)
    at h.throwArgumentError (_app-ca0a8f82dab99437.js:1:267382)
    at Function.from (_app-ca0a8f82dab99437.js:1:215435)
    at N.encode (_app-ca0a8f82dab99437.js:1:206057)
    at _app-ca0a8f82dab99437.js:1:203470
    at Array.forEach (<anonymous>)
    at A (_app-ca0a8f82dab99437.js:1:203340)
    at W.encode (_app-ca0a8f82dab99437.js:1:209030)
    at J.encode (_app-ca0a8f82dab99437.js:1:210407)


const options = {
      type: "erc20",
      amount: Moralis.Units.Token(value, 18),
      receiver: process.env.NEXT_PUBLIC_WALLET_ADDRESS,
      contractAddress: process.env.NEXT_PUBLIC_CONTRACT_ADDRESS,

const transaction = await (Moralis as any).transfer(options);
const transactionResult = await transaction.wait();

what was the value used for value there?
what would be the expected output for that Moralis.Units.Token(value, 18) conversion?

The value is 50 and the expected output is 50 tokens with 18 decimals

Are you sure on that? Can you add logging to see the value?



I solved it by using a BigInt but I still donโ€™t understand the reason for the error

const newValue = BigInt(value * 10 ** 18)

const options = {
    type: "erc20",
    amount: newValue,
    receiver: process.env.NEXT_PUBLIC_MAIN_WALLET,
    contractAddress: process.env.NEXT_PUBLIC_CONTRACT_ADDRESS,

I donโ€™t know either, was the same version of Moralis SDK in localhost and on production?

Same version:

"moralis": "0.0.184",
"react-moralis": "^0.3.11"