Skip to content

Hardhat typescript compilation Errors #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
johhonn opened this issue Nov 23, 2021 · 3 comments
Open

Hardhat typescript compilation Errors #221

johhonn opened this issue Nov 23, 2021 · 3 comments

Comments

@johhonn
Copy link

johhonn commented Nov 23, 2021

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

@aalavandhan
Copy link
Member

Hmm. Are you using node 16?

@adammmanka
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants