title: Uncaught Error: Returned error: VM Exception while processing transaction: revert at evalmachine.<anonymous>
body: <p>I am following dapp university todolist application using solidity. I am trying to call taskCount variable in the console from the deployed instance of the contract I have created, which should display 0 using this code.</p>
  <pre><code>todoList.taskCount()
  </code></pre>
  <p>Instead, I'm met with this error message:</p>
  <pre><code>truffle(ganache)&gt; todoList = await TodoList.deployed()
  undefined
  truffle(ganache)&gt; todoList.address
  '0xA638921e45E90C255C339C6422Ac36ec73C4D1dc'
  truffle(ganache)&gt; todoList.taskCount()
  Uncaught Error: Returned error: VM Exception while processing transaction: revert
      at evalmachine.&lt;anonymous&gt;
      at sigintHandlersWrap (node:vm:269:12)
      at Script.runInContext (node:vm:138:14)
      at runScript (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:369:1)
      at Console.interpret (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:384:1)
      at bound (node:domain:426:15)
      at REPLServer.runBound [as eval] (node:domain:437:12)
      at REPLServer.onLine (node:repl:902:10)
      at REPLServer.emit (node:events:537:28)
      at REPLServer.emit (node:domain:482:12)
      at REPLServer.[_onLine] [as _onLine] (node:internal/readline/interface:425:12)
      at REPLServer.[_line] [as _line] (node:internal/readline/interface:886:18)
      at REPLServer.[_ttyWrite] [as _ttyWrite] (node:internal/readline/interface:1264:22)
      at REPLServer.self._ttyWrite (node:repl:997:9)
      at ReadStream.onkeypress (node:internal/readline/interface:273:20)
      at ReadStream.emit (node:events:537:28)
      at ReadStream.emit (node:domain:482:12)
      at emitKeys (node:internal/readline/utils:358:14)
      at emitKeys.next (&lt;anonymous&gt;)
      at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36) {
    data: {
      '0x5ba781c62915a794566cc1d5d00e48ba45058fdf170b6b910bc45e6447dfa181': { error: 'revert', program_counter: 9, return: '0x' },
      stack: 'RuntimeError: VM Exception while processing transaction: revert\n' +
        '    at Function.RuntimeError.fromResults (/Applications/Ganache.app/Contents/Resources/static/node/node_modules/ganache-core/lib/utils/runtimeerror.js:94:13)\n' +
        '    at /Applications/Ganache.app/Contents/Resources/static/node/node_modules/ganache-core/lib/blockchain_double.js:568:26',
      name: 'RuntimeError'
    },
    hijackedStack: 'Error: Returned error: VM Exception while processing transaction: revert\n' +
      '    at Object.ErrorResponse (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/lib/errors.js:28:1)\n' +
      '    at /usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/web3/node_modules/web3-core-requestmanager/lib/index.js:302:1\n' +
      '    at /usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/packages/provider/wrapper.js:119:1\n' +
      '    at XMLHttpRequest.request.onreadystatechange (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/web3/node_modules/web3-providers-http/lib/index.js:98:1)\n' +
      '    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)\n' +
      '    at XMLHttpRequest.exports.modules.996763.XMLHttpRequest._setReadyState (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)\n' +
      '    at XMLHttpRequest.exports.modules.996763.XMLHttpRequest._onHttpResponseEnd (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:318:1)\n' +
      '    at IncomingMessage.&lt;anonymous&gt; (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:289:48)\n' +
      '    at IncomingMessage.emit (node:events:549:35)\n' +
      '    at IncomingMessage.emit (node:domain:545:15)\n' +
      '    at endReadableNT (node:internal/streams/readable:1359:12)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:82:21)'
  }
  </code></pre>
  <p>How can I get past this error?</p>