0

When I tried to npx hardhat compile, error HH19 showed up I already changed the chai from ^5.0.0 to ^4.3.7 and changed the file name from js to cjs, and the error still shows up. Any ideas on how to fix it?

Before this, this error also showed up. Error: Cannot find module '@nomicfoundation/hardhat-toolbox so I tried with npm install --save-dev @nomicfoundation/hardhat-toolbox --force

package.json

{
  "name": "modify-contract-state",
  "version": "1.0.0",
  "description": ",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@nomicfoundation/hardhat-toolbox": "^4.0.0",
    "hardhat": "^2.19.4"
  },
  "dependencies": {
    "@nomiclabs/hardhat-ethers": "^2.2.3",
    "@nomiclabs/hardhat-waffle": "^2.0.6",
    "chai": "^4.3.7",
    "ethereum-waffle": "^4.0.10",
    "ethers": "^5.7.2"
  }
}

Hardhart config.js

require("@nomicfoundation/hardhat-toolbox");

require("@nomiclabs/hardhat-ethers");

module.exports = {
  solidity: "0.8.4",
};

My reference is from Alchemy University I'm new to blockchain dev and looking forward with you guys

1 Answer 1

0

try to rename

hardhat.config.js

to

hardhat.config.cjs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.