ethers-io / ethers.js

Complete Ethereum library and wallet implementation in JavaScript.
https://ethers.org/
MIT License
7.97k stars 1.85k forks source link

Ethers throws Unhandled Rejection in waitForTransaction method #4822

Open IvanKodak opened 2 months ago

IvanKodak commented 2 months ago

Ethers Version

6.13.2

Search Terms

Unhandled Rejection, waitForTransaction

Describe the Problem

Ethers throws Unhandled Rejection in waitForTransaction method

Github repo with example: https://github.com/IvanKodak/ethers-unhandled-rejection-example

Code Snippet

No response

Contract ABI

No response

Errors

Unhandled Rejection at: Promise {
  <rejected> Error: server response 401 Unauthorized (request={  }, response={  }, error=null, info={ "requestUrl": "https://arb-sepolia.nirvanalabs.xyz/devNode-qz736?apikey=43892a79fb674a1ee81caeb05213dab8065a", "responseBody": "{\n\tjsonrpc\": \"2.0\",\n\t\"id\": 1,\n\t\"error\": { \n\t\"code\": 401,\n\t\"message\": Verification failed, node not found\n\t}\n}\n", "responseStatus": "401 Unauthorized" }, code=SERVER_ERROR, version=6.13.2)
      at makeError (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/utils/errors.ts:694:21)
      at assert (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/utils/errors.ts:715:25)
      at FetchResponse.assertOk (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/utils/fetch.ts:950:15)
      at JsonRpcProvider._send (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:1245:18)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:537:40 {
    code: 'SERVER_ERROR',
    request: FetchRequest {},
    response: FetchResponse {},
    error: undefined,
    info: {
      requestUrl: 'https://arb-sepolia.nirvanalabs.xyz/devNode-qz736?apikey=43892a79fb674a1ee81caeb05213dab8065a',
      responseBody: '{\n' +
        '\tjsonrpc": "2.0",\n' +
        '\t"id": 1,\n' +
        '\t"error": { \n' +
        '\t"code": 401,\n' +
        '\t"message": Verification failed, node not found\n' +
        '\t}\n' +
        '}\n',
      responseStatus: '401 Unauthorized'
    },
    shortMessage: 'server response 401 Unauthorized'
  }
} reason: Error: server response 401 Unauthorized (request={  }, response={  }, error=null, info={ "requestUrl": "https://arb-sepolia.nirvanalabs.xyz/devNode-qz736?apikey=43892a79fb674a1ee81caeb05213dab8065a", "responseBody": "{\n\tjsonrpc\": \"2.0\",\n\t\"id\": 1,\n\t\"error\": { \n\t\"code\": 401,\n\t\"message\": Verification failed, node not found\n\t}\n}\n", "responseStatus": "401 Unauthorized" }, code=SERVER_ERROR, version=6.13.2)
    at makeError (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/utils/errors.ts:694:21)
    at assert (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/utils/errors.ts:715:25)
    at FetchResponse.assertOk (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/utils/fetch.ts:950:15)
    at JsonRpcProvider._send (/Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:1245:18)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/ivankodak/work/ethers-unhandled-rejection-example/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:537:40 {
  code: 'SERVER_ERROR',
  request: FetchRequest {},
  response: FetchResponse {},
  error: undefined,
  info: {
    requestUrl: 'https://arb-sepolia.nirvanalabs.xyz/devNode-qz736?apikey=43892a79fb674a1ee81caeb05213dab8065a',
    responseBody: '{\n' +
      '\tjsonrpc": "2.0",\n' +
      '\t"id": 1,\n' +
      '\t"error": { \n' +
      '\t"code": 401,\n' +
      '\t"message": Verification failed, node not found\n' +
      '\t}\n' +
      '}\n',
    responseStatus: '401 Unauthorized'
  },
  shortMessage: 'server response 401 Unauthorized'
}

Environment

node.js (v12 or newer)

Environment (Other)

No response

IvanKodak commented 2 months ago

@ricmoo could you check please?

DmytroShalaiev commented 1 month ago

Please, same issue

DmytroShalaiev commented 2 weeks ago

@ricmoo please can you check ?