Ethers 4.0.43 breaks type generation
See original GitHub issueUpgrading our codebase from ethers 4.0.41 to 4.0.43 breaks the generated types during compilation.
src/generated/BasicConsumerFactory.ts:13:11 - error TS2345: Argument of type '({ constant: boolean; inputs: { name: string; type: string; }[]; name: string; outputs: never[]; payable: boolean; stateMutability: string; type: string; anonymous?: undefined; } | { constant: boolean; inputs: never[]; ... 5 more ...; anonymous?: undefined; } | { ...; } | { ...; })[]' is not assignable to parameter of type 'string | (string | FunctionFragment | EventFragment)[] | Interface'.
Type '({ constant: boolean; inputs: { name: string; type: string; }[]; name: string; outputs: never[]; payable: boolean; stateMutability: string; type: string; anonymous?: undefined; } | { constant: boolean; inputs: never[]; ... 5 more ...; anonymous?: undefined; } | { ...; } | { ...; })[]' is not assignable to type '(string | FunctionFragment | EventFragment)[]'.
Type '{ constant: boolean; inputs: { name: string; type: string; }[]; name: string; outputs: never[]; payable: boolean; stateMutability: string; type: string; anonymous?: undefined; } | { constant: boolean; inputs: never[]; ... 5 more ...; anonymous?: undefined; } | { ...; } | { ...; }' is not assignable to type 'string | FunctionFragment | EventFragment'.
Type '{ inputs: { name: string; type: string; }[]; payable: boolean; stateMutability: string; type: string; constant?: undefined; name?: undefined; outputs?: undefined; anonymous?: undefined; }' is not assignable to type 'string | FunctionFragment | EventFragment'.
Type '{ inputs: { name: string; type: string; }[]; payable: boolean; stateMutability: string; type: string; constant?: undefined; name?: undefined; outputs?: undefined; anonymous?: undefined; }' is not assignable to type 'FunctionFragment'.
Types of property 'name' are incompatible.
Type 'undefined' is not assignable to type 'string'.
13 super(_abi, _bytecode, signer);
~~~~
src/generated/BasicConsumerFactory.ts:40:34 - error TS2345: Argument of type '({ constant: boolean; inputs: { name: string; type: string; }[]; name: string; outputs: never[]; payable: boolean; stateMutability: string; type: string; anonymous?: undefined; } | { constant: boolean; inputs: never[]; ... 5 more ...; anonymous?: undefined; } | { ...; } | { ...; })[]' is not assignable to parameter of type 'string | (string | FunctionFragment | EventFragment)[] | Interface'.
Type '({ constant: boolean; inputs: { name: string; type: string; }[]; name: string; outputs: never[]; payable: boolean; stateMutability: string; type: string; anonymous?: undefined; } | { constant: boolean; inputs: never[]; ... 5 more ...; anonymous?: undefined; } | { ...; } | { ...; })[]' is not assignable to type '(string | FunctionFragment | EventFragment)[]'.
40 return new Contract(address, _abi, signerOrProvider) as BasicConsumer;
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Documentation - Ethers.js
Solidity provides two types of events, anonymous and non-anonymous. ... Even secure passwords would likely be broken within a short period of time....
Read more >Typings issue for abi files in v4 #633 - ethers-io/ethers.js
On ethers 4.0.37 I get this issue: import { Contract, providers, Signer, ... I've also found that enabling JSON in TypeScript breaks things ......
Read more >ethers/CHANGELOG.md - UNPKG
- Fix backwards compatibility with certain parsed JSON objects passed into Interface and Contracts ([#721](https://github.com/ethers-io/ethers.js/issues/721); [ ...
Read more >ethers - npm
Start using ethers in your project by running `npm i ethers`. ... ethers. TypeScript icon, indicating that this package has built-in type ......
Read more >Resolution Changelog | Unstoppable Domains Developer Portal
1. Fixed bug regarding incompatable types with Ethers InfuraProvider; Remove ability to read from registry directly. ProxyReader address is now ...
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
That change should not have been breaking, since anyone passing in an object of that type would have crashed 2 lines later, but I will put ParamType back into the typing, and rely on runtime errors, which is no worse than previous behaviour.
Sorry for the inconvenience.
Thanks for notifying me @HenryNguyen5 I’ll just close it.