wagmi: bug: hardhat is not recognised for wagmi-cli

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.1.6

Current Behavior

We are trying to use @wagmi/cli in our project which is a monorepo, when you run yarn wagmi generate it gives your the following error :

⠹ Validating plugins
hardhat must be installed to use Hardhat plugin.
To install, run: npm install --save hardhat

Expected Behavior

Since hardhat is a present dependency it should work.

Currently, we have hardhat as our devDependency but even if you move to dependencies it doesn’t work. Tried adding hardhat as different dependencies but it dosen’t work.

check this discussion for more info -> https://github.com/scaffold-eth/se-2/issues/116#issuecomment-1426819707

Steps To Reproduce

clone the repo -> https://github.com/scaffold-eth/se-2 and switch to feat/wagmi-cli branch.

  1. clone the repo and move into se-2 directory
git clone https://github.com/scaffold-eth/se-2
cd se-2
  1. Switch to feat/wagmi-cli branch
git switch feat/wagmi-cli
  1. yarn install
  2. yarn chain
  3. yarn deploy (in new terminal)
  4. yarn wagmi generate (will error out)

check this discussion for more info -> https://github.com/scaffold-eth/se-2/issues/116#issuecomment-1426819707

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

https://github.com/scaffold-eth/se-2

Anything else?

Screenshot 2023-02-19 at 9 22 11 AM

PS : If you do npm install --save hardhat in packages/hardhat and run yarn install after it works nicely but don’t want to do it 🙌

Thanks 🙏

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments