2

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

MehmedB
  • 1,059
  • 1
  • 16
  • 42

1 Answers1

2

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.

Midha Tahir
  • 128
  • 2
  • 8