PatrickAlphaC / hardhat-fund-me-fcc

82 stars 183 forks source link

TypeError at deploying mocks #51

Closed JIC1816 closed 2 years ago

JIC1816 commented 2 years ago

I'm trying to deploy with this command line "yarn hardhat deploy --tags mocks", but I keep getting this error message:

Error: ERROR processing /home/jic1816/FCC-Solidity/hardhat-fund-me/deploy/00-deploy-mocks.js:
TypeError: Cannot read properties of undefined (reading 'length')

What could be the problem? The error's next lines don't point to any file that I've written but to "helpers.ts" from "hardhat-deploy". First I tried compiling the files that I wrote alongside Patrick's video, but then I also tried copying and pasting the files from github. Neither way worked.

Thank you!

PS: I didn't use the "advance sample project" in Hardhat (because of the update), but I guess it has nothing to do with this. Right?

JIC1816 commented 2 years ago

It was a problem with my hardhat.config.js file. The error arose because I didn't use "advanced sample project" in hardhat, like the tutorial explains, because it's not an option anymore in the latest hardhat upgrade. So I copied the hardhat.config from tutorial, it worked, and then I tried to look where the differential/significant part would be, turns out that I needed this:

namedAccounts: {
deployer: {
default: 0,
1: 0,
},
},