Skip to content

Error: invalid value for value.nonce #5116

@darrengame

Description

@darrengame

Ethers Version

6.16.0

Search Terms

No response

Describe the Problem

sendTransaction will error reson: invalid value for value.nonce (invalid numeric string: Cannot convert undefined to a BigInt (argument="value", value="undefined", code=INVALID_ARGUMENT, version=6.16.0))

Code Snippet

try {
      const provider = new ethers.BrowserProvider(window.ethereum);
      const signer = await provider.getSigner();
      const tx = await signer.sendTransaction({
        to: address, 
        value: amountToPay, 
      });
      const receipt = await tx.wait();
      egf.Logger.log(
        `transaction hash: ${tx.hash}, block number: ${receipt.blockNumber}`,
      );

    } catch (error) {
      console.error('pay transaction error:', error);
    }

Contract ABI

signer.sendTransaction

Errors

invalid value for value.nonce (invalid numeric string: Cannot convert undefined to a BigInt (argument="value", value="undefined", code=INVALID_ARGUMENT, version=6.16.0))

Environment

No response

Environment (Other)

No response

Metadata

Metadata

Assignees

Labels

investigateUnder investigation and may be a bug.v6Issues regarding v6

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions