ampleforth-contracts
ampleforth-contracts copied to clipboard
Hardhat typescript compilation Errors
After cloning master branch and installing with yarn I get the following errors when trying to run yarn test
scripts/deploy.ts:32:69 - error TS2345: Argument of type 'SignerWithAddress' is not assignable to parameter of type 'Signer'. Property 'getFeeData' is missing in type 'SignerWithAddress' but required in type 'Signer'.
32 (await hre.ethers.getContractFactory('UFragments')).connect(deployer), ~~~~~~~~
node_modules/@ethersproject/abstract-signer/lib/index.d.ts:38:5 38 getFeeData(): Promise<FeeData>; ~~~~~~~~~~ 'getFeeData' is declared here. scripts/deploy.ts:45:11 - error TS2345: Argument of type 'SignerWithAddress' is not assignable to parameter of type 'Signer'.
45 deployer, ~~~~~~~~ scripts/deploy.ts:59:16 - error TS2345: Argument of type 'SignerWithAddress' is not assignable to parameter of type 'Signer'.
59 .connect(deployer) ~~~~~~~~ scripts/deploy.ts:100:9 - error TS2345: Argument of type 'SignerWithAddress' is not assignable to parameter of type 'Signer | Provider | undefined'. Type 'SignerWithAddress' is not assignable to type 'Signer'.
100 deployer, ~~~~~~~~ scripts/deploy.ts:112:9 - error TS2345: Argument of type 'SignerWithAddress' is not assignable to parameter of type 'Signer | Provider | undefined'. Type 'SignerWithAddress' is not assignable to type 'Signer'.
112 deployer, ~~~~~~~~ scripts/deploy.ts:149:16 - error TS2345: Argument of type 'SignerWithAddress' is not assignable to parameter of type 'Signer'.
149 .connect(deployer) ~~~~~
Hmm. Are you using node 16?
Got This working with @johhonn @aalavandhan not sure how... heres the steps to fix on both environments... we rolled back the version to node v12.20.2 yarn install yarn add ethers yarn hardhat got us to a working stage. still scratching our heads a bit i am going to try with newer node version.
Pulled fresh repos seems to be working with 16.13.0 node not sure how the bug happened. I had reproduced the same error on my environment as @johhonn unsure what was going on. its very odd likely lock conflicts for yarn or package we shared the same local repo. anything could have happened no issues rn