Repository navigation
npx hardhat -h errors #7930
Replies: 3 comments
|
Hey @solidcodes, you are running This sounds like hardhat is not properly installed, or that your If you replace your import { defineConfig } from "hardhat/config";
export default defineConfig({
solidity: {
version: "0.8.28",
},
});Then rerun |
|
well, when I copy pasted your codes. But I'm following this tutorial below, and it produces errors. |
|
The tutorial itself works; the error comes from Hardhat 2 plugins installed in a Hardhat 3 project. Your other thread (#7984, same // node_modules/@nomicfoundation/hardhat-verify/src/internal/errors.ts (v2)
import { NomicLabsHardhatPluginError } from "hardhat/plugins";
export class HardhatVerifyError extends NomicLabsHardhatPluginError { ... }Hardhat 3's I reproduced it with Fix: remove the Hardhat 2 packages and install the ones the tutorial uses (Using a Hardhat plugin step): npm uninstall @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-verify @nomicfoundation/hardhat-ethers @nomicfoundation/hardhat-chai-matchers
# on Windows: rmdir /s /q node_modules & del package-lock.json
rm -rf node_modules package-lock.json
npm install --save-dev hardhat@latest @nomicfoundation/hardhat-toolbox-viem @nomicfoundation/hardhat-ignition viem(Upgrade
import hardhatToolboxViemPlugin from "@nomicfoundation/hardhat-toolbox-viem";
import { defineConfig } from "hardhat/config";
export default defineConfig({
plugins: [hardhatToolboxViemPlugin],
solidity: { version: "0.8.28" },
});After that, with a Rule of thumb: in a Hardhat 3 project, never install (Reproduced and verified locally on Node 22 with an AI assistant's help.) |
Uh oh!
There was an error while loading. Please reload this page.
when I type npx hardhat -h in bash, these are the errors below, how to fix them? I'm using hardhat version 3.
An unexpected error occurred:
TypeError: Class extends value undefined is not a constructor or null
at Object. (C:\Users\solid\hardhat-tutorial\node_modules@nomicfoundation\hardhat-verify\src\internal\errors.ts:9:41)
at Module._compile (node:internal/modules/cjs/loader:1706:14)
at Object..js (node:internal/modules/cjs/loader:1839:10)
at Module.load (node:internal/modules/cjs/loader:1441:32)
at Function._load (node:internal/modules/cjs/loader:1263:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Module.require (node:internal/modules/cjs/loader:1463:12)
at require (node:internal/modules/helpers:147:16)
at Object. (C:\Users\solid\hardhat-tutorial\node_modules@nomicfoundation\hardhat-verify\src\index.ts:27:1)
If you think this is a bug in Hardhat, please report it here: https://hardhat.org/report-bug
All reactions