TypeChain
TypeChain copied to clipboard
.ts files cannot resolve typings
If I run npx hardhat clean followed by npx hardhat test I receive the following:
% npx hardhat test
Generating typings for: 60 artifacts in dir: ./types for target: ethers-v5
Successfully generated 85 typings!
Compiled 55 Solidity files successfully
An unexpected error occurred:
test/A.test.ts:8:8 - error TS2307: Cannot find module './../../types' or its corresponding type declarations.
8 } from "./../../types";
~~~~~~~~~~~~~~~
% npx hardhat test
No need to generate any newer typings.
Upon running npx hardhat test the first time it appears that the typings are generated but the .ts cannot resolve them before executing. When I run npx hardhat test for the second time the tests run without a hitch.
Similarly, if I run npx hardhat clean, npx hardhat typechain, npx hardhat test manually I have no issues.