'type' folder layout changed and unable to import type for ethers. #169
Replies: 3 comments
-
|
Hello @code-brewer! Thanks for taking the time to write such a detailed question. Unfortunately, I am no longer using this template on a regular basis (I am using Foundry now), so I don't know how to answer your question. You might have better luck looking for help in the Hardhat Discord server. |
Beta Was this translation helpful? Give feedback.
-
|
@code-brewer thanks for decumenting what I also experienced. I just created a new project with the template from hardhat. That is pretty minimalistic in its configuration. hardhat.config.ts import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
const config: HardhatUserConfig = {
solidity: "0.8.19",
};
export default config;... and looks like it does not show that (new ?) behavior. @PaulRBerg maybe behaviours is (now) different if |
Beta Was this translation helpful? Give feedback.
-
|
Update: even more confusing, I started with a fresh now template yesterday, replaced Greeter with my contract ... and it did not put the *.ts files in subfolders. Then I added another contract, also straight into the The standard hardhat template does not show the behaviour. I looked if I could find some configuration somewhere which might cause the different behaviour, but could not find anything. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I use this template, it compile and test ok without modification.
After that, I installed '"@openzeppelin/contracts": "^4.9.2"' , and add my empty contact that inherit from openzeppelin's Ownable
Then, the vscode IDE prompt unable to import types, such as
Cannot find module 'hardhat' or its corresponding type declarations.I notice that the 'type' folder layout changed.
Origianl was:
now the layout is:
After fix Greeter/Greeter__factory import path , as:
there still error for

import { ethers } from "hardhat";So, I thought about two question:
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions