Olá,
Estou recebendo o seguinte erro abaixo no meu lista.ejs. Alguêm tem alguma ideia do que pode ser?
TypeError: C:\nodejstraining\app\views\produtos\lista.ejs:14
12| </thead>
13| <tbody>
>> 14| <% for(var i=0; i < lista.length; i++) {%>
15| <tr>
16| <td><%= lista[i].titulo %></td>
17| <td><%= lista[i].preco %></td>
Cannot read property 'length' of undefined
at eval (eval at <anonymous>
<div>
<div>
<h2>Listagem de livros</h2>
<div>
<table>
<thead>
<tr>
<td><a href="">titulo</a></td>
<td><a href="">preco</a></td>
<td><a href="">descricao</a></td>
</tr>
</thead>
<tbody>
<% for(var i=0; i < lista.length; i++) {%>
<tr>
<td><%= lista[i].titulo %></td>
<td><%= lista[i].preco %></td>
<td><p><%= lista[i].descricao%></p></td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
</div>