ampleforth-contracts icon indicating copy to clipboard operation
ampleforth-contracts copied to clipboard

Hardhat typescript compilation Errors

Open johhonn opened this issue 4 years ago • 3 comments
trafficstars

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) ~~~~~

johhonn avatar Nov 23 '21 03:11 johhonn

Hmm. Are you using node 16?

aalavandhan avatar Nov 24 '21 16:11 aalavandhan

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.

adammmanka avatar Dec 09 '21 02:12 adammmanka

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

adammmanka avatar Dec 09 '21 02:12 adammmanka