Ganache's provider type is not compatible with Web3
See original GitHub issueit’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:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve confirmed that types from Ganache v7.0.2 and above are compatible with web3 v1.7.3.
Does adding
"skipLibCheck": true
temporarily fix it for you?