Skip to content

Lesson 9 Cannot read properties of undefined (reading 'length') #5625

Answered by alymurtazamemon
bbl4de asked this question in Q&A
Discussion options

You must be logged in to vote

@Bartekl-13 It is throwing an undefined error because the deployer is undefined. Your deploy script is not able to read your env variables because you have added const before them const PRIVATE_KEY ="SECRET" this is not javascript!

update these like this;

- const SEPOLIA_RPC_URL ="https://eth-sepolia.g.alchemy.com/v2/..."
- const PRIVATE_KEY ="SECRET"
- const ETHERSCAN_API_KEY ="..."
+ SEPOLIA_RPC_URL="https://eth-sepolia.g.alchemy.com/v2/..."
+ PRIVATE_KEY="SECRET"
+ ETHERSCAN_API_KEY="..."

And one more thing, your etherscan and alchemy API keys are important too, do not share them as well.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bbl4de
Comment options

Answer selected by bbl4de
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