dappuniversity / election

A Decentralized Ethereum Voting Application Tutorial
563 stars 506 forks source link

web3.eth.accounts[0] returns undefined and app.vote(1,{ from:web3.eth.accounts[0] }) is giving error #53

Open nik92eth opened 3 years ago

nik92eth commented 3 years ago

If anybody is struggling with this. Solution

eirchaid commented 2 years ago

Did you solve the problems? I have this one: truffle(development)> app.vote(1, {from:accounts[2]}) evalmachine.:0 app.vote(1, {from:accounts[0]}) ^

Uncaught ReferenceError: app is not defined at evalmachine.:0:1 at sigintHandlersWrap (vm.js:272:15) at Script.runInContext (vm.js:127:14) at runScript (C:\Users\Eirini\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\console.js:227:1) at Console.interpret (C:\Users\Eirini\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\console.js:242:1) at ReplManager.interpret (C:\Users\Eirini\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\repl.js:129:1) at bound (domain.js:427:14) at REPLServer.runBound [as eval] (domain.js:440:12) at REPLServer.onLine (repl.js:760:10) at REPLServer.emit (events.js:315:20)

eirchaid commented 2 years ago

i fixed it!