question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ganache's provider type is not compatible with Web3

See original GitHub issue

it’s a matter of (payload: JsonRpcRequest<...>, callback?: Callback | undefined) (the relevant part of the type on Ganache) vs (payload: JsonRPCRequest, callback: Callback<JsonRPCResponse>)

Full error:

    test/encoder.test.ts:76:50 - error TS2345: Argument of type 'EthereumProvider_2' is not assignable to parameter of type 'Provider'.
      Types of property 'send' are incompatible.
        Type '{ <Method extends never>(method: Method, params?: NoUnknownArray<Parameters<Overloads<EthereumApi[Method]>>> | undefined): cleanAndMergePromiseGenerics<...>; <Method extends never>(payload: JsonRpcRequest<...>, callback?: Callback | undefined): undefined; <Method extends never>(payloads: JsonRpcRequest<...>[], callb...' is not assignable to type '(payload: JsonRPCRequest, callback: Callback<JsonRPCResponse>) => any'.
          Types of parameters 'params' and 'callback' are incompatible.
            Type 'Callback<JsonRPCResponse>' is not assignable to type 'undefined'.
            ```

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MicaiahReidcommented, Apr 21, 2022

I’ve confirmed that types from Ganache v7.0.2 and above are compatible with web3 v1.7.3.

0reactions
davidmurdochcommented, Apr 8, 2022

Does adding "skipLibCheck": true temporarily fix it for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web3RequestManager is not compatible with the Ganache ...
Ganache should work fine with the web3 request manager. Steps to Reproduce. Mentioned above. Web3.js Version. 4.x. Environment. Operating System ...
Read more >
Using ganache-cli provider causes "Error: Provider not set or ...
I have read the solution in one of Stephen Grider's Udemy course: const assert = require('assert'); const ganache = require('ganache-cli'); ...
Read more >
Method eth_maxPriorityFeePerGas not supported, web3.py ...
This is an issue from a new edition of web3.py. You need to add gasPrice to your transaction, like so:
Read more >
Ganache 7 Ethereum Simulator - Building on Web3 is now ...
An ethers.js provider. See code samples for these different use cases below. To begin, install Ganache 7 as npm package in your Node.js ......
Read more >
Interacting with a Smart Contract through Web3.js (Tutorial)
The Ganache is a Node.js Ethereum client for the testing and developing ... It's saying that if web3 is not undefined, then we'll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found