TypeError: Cannot read properties of undefined (reading 'length') #4759
-
hello i have tried going around this error but cant am in lesson 9 and i keep getting this error after my mocks have deployed successfully what could be the issue Nothing to compile local network has been detected now we are Deploying mocks ... deploying "VRFCoordinatorV2Mock" (tx: 0x12925340c9bd03dbda39b85b0c207149c2bc46f19e3a0c825e92642eb0713167)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 2539340 gas Mocks deployed! -------------------------------------------------------------- An unexpected error occurred: Error: ERROR processing C:\Users\spectre\workspace\smart-contract-lottery\deploy\01-deploy-raffle.js: TypeError: Cannot read properties of undefined (reading 'length') at getFrom (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\helpers.ts:1727:14) at _deploy (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\helpers.ts:534:9) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at listOnTimeout (node:internal/timers:533:9) at processTimers (node:internal/timers:507:7) at _deployOne (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\helpers.ts:1005:16) at Object.module.exports [as func] (C:\Users\spectre\workspace\smart-contract-lottery\deploy\01-deploy-raffle.js:50:18) at DeploymentsManager.executeDeployScripts (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1219:22) at DeploymentsManager.runDeploy (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1052:5) at DeploymentsManager.executeDeployScripts (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1222:19) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at listOnTimeout (node:internal/timers:533:9) at processTimers (node:internal/timers:507:7) at DeploymentsManager.runDeploy (C:\Users\spectre\workspace\smart-contract-lottery\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1052:5) at SimpleTaskDefinition.action (C |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Tip: while I was going through the video and having errors I tried using the search bar first. Just type "TypeError: Cannot read properties of undefined (reading 'length') " and you'll see a bunch of them. Sift through and you'll find your answer I am confident. Happened to me as well. Look below. another Tip: |
Beta Was this translation helpful? Give feedback.
-
Hi @pratokko - I hope you already solved the issue, but if you didn't, check your code and the syntax from .config and deploy scripts. Happens that we forget to write a parentheses, letter or misspell a variable name. |
Beta Was this translation helpful? Give feedback.
-
@pratokko Make sure you have this in hardhat config file; namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
}, |
Beta Was this translation helpful? Give feedback.
@pratokko Make sure you have this in hardhat config file;