hardhat task from dedicated file -- fails to build with Typechain import
See original GitHub issueProblem:
cant use hardhat
if task imports typechain contract;
task has to be defined in dedicated file and imported into hardhat config;
Reproduce: https://github.com/rad-p/TypeChain/commit/128b6020cb73c9d5521a0e037bdec0efa9d8c24b
can’t use yarn hardhat
call:
.../TypeChain/examples/hardhat
❯ yarn hardhat typechain
yarn run v1.22.10
$ /home/mr13/projects/ethereum-ts/TypeChain/examples/hardhat/node_modules/.bin/hardhat typechain
An unexpected error occurred:
tasks/counter.ts:2:23 - error TS2307: Cannot find module '../typechain' or its corresponding type declarations.
2 import {Counter} from "../typechain";
~~~~~~~~~~~~~~
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
env:
❯ node --version
v14.16.1
❯ yarn --version
1.22.10
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Task and typechain on first run · Issue #1511 - GitHub
I have to manually open hardhat.config.ts , comment the import of the tasks which import TypeChain, run the TypeChain task, then uncomment the...
Read more >Hardhat errors | Ethereum development environment for ...
The most common source of errors is trying to import the Hardhat Runtime Environment from your config or a file imported from it....
Read more >How to Build a Full Stack NFT Marketplace - V2 (2022)
If you get an error referencing your README.md, delete README.md and run npx hardhat again. Now you should see the following files and...
Read more >How to create tests for your Solidity Smart Contract | by StErMi
When you create unit testing you are using Hardhat local blockchain and not a “real” one where people mint blocks every X seconds....
Read more >Hardhat & Nomic Foundation: the creation of an Ethereum non ...
Building a DApp: What are DApps and why Meteor preview ... Nagy and Viktor Tron present on Swarm, the decentralised, incentivised file storage...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
agree to reopen this
The only workaround I know works is using
import type {...} from "..."
, and runningTS_NODE_TRANSPILE_ONLY=1 npx hardhat compile
.