0

enter image description hereHelp me figure out how to install and use hardhat-deploy. After installing it, I add to the hardhat.config.ts file, the line - import "hardhat-deploy"; And when running a node - npx hardhat node, I get an error: TypeError: Cannot read properties of undefined (reading 'length'). If I remove this line from hardhat.config.ts, the terminal does not recognize the command - npx hardhat deploy --network localhost, after starting the node. Where is the mistake?

2

1 Answer 1

0

To begin with you should add localhost network to your config which is the default hardhat network. in addition you should add this to your hardhat config:(the main reason)

namedAccounts:{
deployer:{
  default:0
}

} furthermore you could use the file naming convention in the deploy folder as official docs said: 000_*.ts

last but not least you could install hardhat shorthand command to getting ride of npx hardhat haha..

If it's useful please vote it up :)

Your Answer

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

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