Getting type error when running hardhat compile
See original GitHub issueI’m relatively new to Typescript but not so much ethers, have been using it + hardhat & waffle for a bit now. I was refactoring an older codebase to TS to learn & I quickly figured out I needed typechain to save my sanity (it’s truly awesome btw).
I’ve read the docs & everything seems to be straightforward, I’ve installed the correct packages & versions per the examples given. However, I keep running into this error when running hardhat compile:
TypeError: (0 , typechain_1.glob) is not a function
I’ve tried uninstalling & reinstalling everything (saw somewhere that someone fixed this by reinstalling waffle after typechain so tried that as well) and I just can’t seem to get it to work after a few hours of debugging.
Dev dependencies are here:
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.4",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@typechain/hardhat": "^4.0.0",
"@types/node": "17.0.8",
"@types/react": "17.0.38",
"autoprefixer": "^10.4.2",
"chai": "^4.3.4",
"eslint": "8.6.0",
"eslint-config-next": "12.0.8",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.5.3",
"hardhat": "^2.8.2",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.18",
"typechain": "^4.0.1",
"typescript": "4.5.4"
}
Any help would be greatly appreciated, thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Boom! Updating the typechain & @typechain/ethers-v5 got it done for me. Very interesting, it would appear that when spinning up the hardhat project & installing the usual dependencies (namely Waffle), Waffle is using a super old version of Typechain that will also cause dependency tree errors if not updated manually.
Thank you @krzkaczor !! I really appreciate it man, will make sure to check for these older versions getting snuck in there moving forward
@0xGenghisGoose np. I am gonna pressure waffle team to move typechain to peer dep and bump it. It should fix this issue.