Lesson 9 Cannot read properties of undefined (reading 'length') #5625
-
|
Hi, I'm having issues with deploying my script to sepolia testnet. I read every discussion about this error and didn't find a solution. The numbers in this message were added by me while trying to find the location of the issue. That's my 01-deployer-raffle.js: I'm not sure if any other files are necessary for this problem to be solved so i will just in case add my helpers-hardhat-config: and my hardhat-config.js: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@Bartekl-13 It is throwing an undefined error because the 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. |
Beta Was this translation helpful? Give feedback.
@Bartekl-13 It is throwing an undefined error because the
deployeris undefined. Your deploy script is not able to read your env variables because you have added const before themconst PRIVATE_KEY ="SECRET"this is not javascript!update these like this;
And one more thing, your etherscan and alchemy API keys are important too, do not share them as well.