Skip to content

TypeError: Cannot read property 'length' of undefined - Lesson 7, 10:48:53 #69

Discussion options

You must be logged in to vote

Amazing question!

When you call await getNamedAccounts(), it looks in your hardhat.config.js for the namedAccounts section, and reads the length of the named accounts.

You'll want to make sure this is in there!

    namedAccounts: {
        deployer: {
            default: 0, // here this will by default take the first account as deployer
        },
    },

One addition, please add the name of the language to the 3 backticks when formatting, like so:

```javascript
//code here

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@PatrickAlphaC
Comment options

@0xrishavsharma
Comment options

@PatrickAlphaC
Comment options

@0xrishavsharma
Comment options

Answer selected by PatrickAlphaC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants