Open naddison36 opened 1 year ago
This seems to be caused by Typechain normalizing files/directories names by simply removing special symbols; in this case, it's importing from "./.."
, which after normalized, becomes ""
.
We got a similar issue, but with version-named folders:
import type * as 047 from './0.4.7';
047
is the naive normalization of the path, but isn't a valid identifier, and prettier is rightfully complaining.
Whatever function is generating those alias import names, should make sure they're both unique and valid.
Thanks for commenting @andrevmatos.
The contracts in @account-abstraction/contracts do use relative paths but so does openzeppelin-contracts which does work with Typechain when imported to a project.
I'll try stripping out the contracts in @account-abstraction/contracts to see if I can isolate which contracts are causing the problem.
I'm trying to use the ERC-4337 contracts in the @account-abstraction/contracts package.
I've created a simple Hardhat project that attempts to compile and generate types for the @account-abstraction contracts. To replicate, please use the
typechain
branch as that is barebones. https://github.com/naddison36/abstract-accounts/tree/typechainWhen I compile the project using
yarn compile
, I get the following errorInterestingly, types are created in the
src/types
andsrc/types/types
folders. If I just use the Hardhat typechain plug-in defaults, types are created intypechain-types
and the project root.I've kept the installed packages to a minimum to try and isolate the problem
The typechain config in Hardhat is