Strange error in terminal after importing hardhat-gas-reporter in HardHat SimpleStorage #2720
Replies: 2 comments 2 replies
-
first problem: second problem: |
Beta Was this translation helpful? Give feedback.
-
It should be fixed after the following:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am doing the HardHat simple storage project right now, and I have just installed the hardhat-gas-reporter plugin. When trying to install it, I got this error:
Error HH801: Plugin @nomicfoundation/hardhat-toolbox requires the following dependencies to be installed: @ethersproject/providers, @nomicfoundation/hardhat-network-helpers, @nomicfoundation/hardhat-chai-matchers, @nomiclabs/hardhat-ethers, @types/chai, @types/mocha, @typechain/ethers-v5, @typechain/hardhat, chai, solidity-coverage, ts-node, typechain, typescript. Please run: npm install --save-dev "@ethersproject/providers@^5.4.7" "@nomicfoundation/hardhat-network-helpers@^1.0.0" "@nomicfoundation/hardhat-chai-matchers@^1.0.0" "@nomiclabs/hardhat-ethers@^2.0.0" "@types/chai@^4.2.0" "@types/mocha@^9.1.0" "@typechain/ethers-v5@^10.1.0" "@typechain/hardhat@^6.1.2" "chai@^4.2.0" "solidity-coverage@^0.8.1" "ts-node@>=8.0.0" "typechain@^8.1.0" "typescript@>=4.5.0"
This was weird, but I just did what the message recommended and I installed the listed packages using yarn. So this error is NOT the direct problem at the moment. However, when I tried to run
yarn hardhat test
I get a new error.` SimpleStorage
·-----------------------|----------------------------|-------------|-----------------------------·
| Solc version: 0.8.7 · Optimizer enabled: false · Runs: 200 · Block limit: 30000000 gas │
························|····························|·············|······························
| Methods │
·············|··········|··············|·············|·············|·············|················
| Contract · Method · Min · Max · Avg · # calls · usd (avg) │
·------------|----------|--------------|-------------|-------------|-------------|---------------·
0 passing (30ms)
1 failing
"before each" hook for "Should start with a favorite number of 0":
TypeError: Cannot read properties of undefined (reading 'prototype')
at registerCustomInspection (node_modules/@nomiclabs/hardhat-ethers/src/internal/index.ts:21:13)
at /Users/trevorwright/Documents/Projects/hardhat-simple-storage-fcc/hardhat-simple-storage-fcc/node_modules/@nomiclabs/hardhat-ethers/src/internal/index.ts:33:5
at getRealTarget (node_modules/hardhat/src/internal/util/lazy.ts:112:22)
at Object.get (node_modules/hardhat/src/internal/util/lazy.ts:185:26)
at Context. (test/test-deploy.js:7:41)
at processImmediate (node:internal/timers:471:21)`
I am not really sure how to solve this. It just happened when I installed hardhat-gas-reporter package. Can someone help me out?
Beta Was this translation helpful? Give feedback.
All reactions