PatrickAlphaC / hardhat-fund-me-fcc

82 stars 184 forks source link

Error while running FundMe.test.js #171

Closed Vaishnavikv2 closed 1 year ago

Vaishnavikv2 commented 1 year ago

I am receiving an error when running the "npx hardhat test" command. After running this command I am getting this error .

0 passing (1s) 1 failing 1) FundMe "before each" hook for "sets the aggregator addresses correctly": TypeError: (0 , ethers_1.getAddress) is not a function at new HardhatEthersSigner (node_modules\@nomicfoundation\hardhat-ethers\src\signers.ts:73:30) at Function.create (node_modules\@nomicfoundation\hardhat-ethers\src\signers.ts:65:12) at processTicksAndRejections (node:internal/process/task_queues:95:5) at getSigner (node_modules\@nomicfoundation\hardhat-ethers\src\internal\helpers.ts:60:29) at async Promise.all (index 0) at getSigners (node_modules\@nomicfoundation\hardhat-ethers\src\internal\helpers.ts:45:30) at getContractAtFromArtifact (node_modules\@nomicfoundation\hardhat-ethers\src\internal\helpers.ts:402:21) at Context. (test\unit\FundMe.test.js:17:18)

(I have also tried updating the ether version to 5.7.2 but same error persist)

Vaishnavikv2 commented 1 year ago

I have made changes after reading the discussions and the error has now solved If you are facing the same issue then change the package.json and then use npm i --force Also import these into your hardhat.config.js require("@nomicfoundation/hardhat-toolbox") require("dotenv").config() require("hardhat-deploy") Thank you