Reputation: 1137
I am working on a dApp using this repository: https://github.com/ipfs-shipyard/nft-school-examples/tree/main/end-to-end I am trying to import the hardhat. I've installed it with yarn add hardhat
. When I import the hardhat with const _hardhat = require("hardhat")
and run yarn start
; I get the following error:
Failed to compile.
./node_modules/undici/lib/api/api-request.js
Module not found: Can't resolve 'async_hooks' in '/home/bugra/deneme/end-to-end/packages/react-app/node_modules/undici/lib/api'
How can I resolve this issue? How can I use hardhat within the packages/react-app/src/components/Minter.jsx
Upvotes: 2
Views: 401
Reputation: 138
if you are importing ethers make sure to import it from 'ethers' library.
I have got this issue on react, after wasting much time I realized that I was importing ethers from hardhat. After importing it from ethers everything works.
Upvotes: 2