Skip to content
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

Cannot read properties of null (reading 'id') in provider-jsonrpc.ts:549:66 #4679

Open
IvanKodak opened this issue Apr 2, 2024 · 0 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@IvanKodak
Copy link

IvanKodak commented Apr 2, 2024

Ethers Version

6.11.1

Search Terms

Cannot read properties of null

Describe the Problem

When I try to broadcast a transaction that was broadcasted a moment ago, I receive an error:
{"error":{"message":"Cannot read properties of null (reading 'id')","stack":"TypeError: Cannot read properties of null (reading 'id')\n at /***modules/ethers/src.ts/providers/provider-jsonrpc.ts:549:66\n at Array.filter (<anonymous>)\n at /***modules/ethers/src.ts/providers/provider-jsonrpc.ts:549:49\n at processTicksAndRejections (node:internal/process/task_queues:95:5)"}

As I understand it means that the provider didn't return the response"id", but I didn't find a place where you check that a response payload from a provider has a property "id". Maybe need to check it and throw some standard error.

Notes:

  • I have disabled batch request: "batchMaxCount: 1"
  • I reproduce this case only when I send a request to the QuickNode ETH provider(https://www.quicknode.com/)
  • I didn't reproduce this case on testnet, only on mainnet

Code Snippet

// When on the second iteration I use quickNode provider, it throws an error that I added to the issue description. 
// So I think the problem occurred when I tried to broadcast the transaction via quickNode node which was broadcasted.
// this._broadcastTransactionCount = 2
for (let i = 0; i < this._broadcastTransactionCount; i++) {
  await broadcastTx(txData, provider);
}

Contract ABI

No response

Errors

{"error":{"message":"Cannot read properties of null (reading 'id')","stack":"TypeError: Cannot read properties of null (reading 'id')\n    at /***modules/ethers/src.ts/providers/provider-jsonrpc.ts:549:66\n    at Array.filter (<anonymous>)\n    at /***modules/ethers/src.ts/providers/provider-jsonrpc.ts:549:49\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)"}

Environment

node.js (v12 or newer)

Environment (Other)

No response

@IvanKodak IvanKodak added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants