0

enter image description here

I am doing the "TodoList" exercise and when I use truffle (development), I do not return the call with task, I get the following error:

truffle (development)> todoList = await TodoList.deployed ()
undefined
truffle (development)> task = await TodoList.task (1)
TypeError: TodoList.task is not a function
     at evalmachine. <anonymous>: 1: 16

Truffle version 5.0.22

This is my first post, your help will be very important to meenter image description here

  • The method is tasks according to the tutorial. Use task = await todoList.tasks(1) – amal Jun 16 '19 at 11:52
  • 1
    For anyone interested, here's a link to Gregory's tutorial – amal Jun 16 '19 at 11:54
  • Thanks for your response, I am following that same tutorial. At the moment of entering the same function as you say, I get the following error: TypeError: TodoList.task is not a function at evalmachine. : 1: 16 – TIri Jun 16 '19 at 19:42
  • 1
    TodoList.task singular, is not the same as TodoList.tasks plural – amal Jun 16 '19 at 19:46
  • I tried with tasks, but it did not work for me. What can be ?. I updated with another image – TIri Jun 18 '19 at 4:17
1

try this:

task = await todoList.tasks(1)

instead of

task = await TodoList.task (1)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.