Skip to content
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

An unexpected error occurred when run yarn compile #59

Closed
hadv opened this issue Aug 19, 2021 · 3 comments
Closed

An unexpected error occurred when run yarn compile #59

hadv opened this issue Aug 19, 2021 · 3 comments

Comments

@hadv
Copy link

hadv commented Aug 19, 2021

An unexpected error occurred when run yarn compile as below output log due to hardhat compile the task before compile the smart contract?

An unexpected error occurred:

tasks/deployers/greeter.ts:4:43 - error TS2307: Cannot find module '../../typechain' or its corresponding type declarations.

4 import { Greeter, Greeter__factory } from "../../typechain";
@PaulRBerg
Copy link
Owner

Yeah this is a known issue, it's a catch-22 caused by the fact that one of the Hardhat tasks imports the TypeChain bindings which are not generated yet. See dethcrypto/TypeChain#371.

It can be fixed by adding TS_NODE_TRANSPILE_ONLY=true before running the command, but that'd be a chore. That's why I added this flag in the typechain script in package.json; I should create a compile script and add the flag in there too.

@hadv
Copy link
Author

hadv commented Aug 20, 2021

It can be fixed by adding TS_NODE_TRANSPILE_ONLY=true before running the command, but that'd be a chore. That's why I added this flag in the typechain script in package.json; I should create a compile script and add the flag in there too.

Yeah, this way might be better

@PaulRBerg
Copy link
Owner

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

Successfully merging a pull request may close this issue.

2 participants