Olá. Comecei a fazer a parte de socket.io, mas travei novamente, agora aparece a seguinte mensagem:
SyntaxError: Unexpected token catch in C:\Users\Gisele\Documents\Alura\Node\casadocodigo\app\views\promocoes\form.ejs while compiling ejs
at new Function (<anonymous>)
at Template.compile (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\ejs\lib\ejs.js:491:12)
at Object.compile (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\ejs\lib\ejs.js:306:16)
at handleCache (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\ejs\lib\ejs.js:169:18)
at View.exports.renderFile [as engine] (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\ejs\lib\ejs.js:374:14)
at View.render (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\express\lib\view.js:126:8)
at tryRender (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\express\lib\application.js:639:10)
at Function.render (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\express\lib\application.js:591:3)
at ServerResponse.render (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\express\lib\response.js:960:7)
at Query._callback (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\app\routes\promocoes.js:6:17)
at Query.Sequence.end (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\mysql\lib\protocol\sequences\Sequence.js:86:24)
at Query._handleFinalResultPacket (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\mysql\lib\protocol\sequences\Query.js:144:8)
at Query.EofPacket (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\mysql\lib\protocol\sequences\Query.js:128:8)
at Protocol._parsePacket (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\mysql\lib\protocol\Protocol.js:280:23)
at Parser.write (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\mysql\lib\protocol\Parser.js:74:12)
at Protocol.write (C:\Users\Gisele\Documents\Alura\Node\casadocodigo\node_modules\mysql\lib\protocol\Protocol.js:39:16)
form.ejs
<html>
<body>
<form action='/promocoes' method="post">
<div>
<input type="text" name="mensagem"/>
</div>
<div>
<select name="livro[id]">
<%for(var i=0;i<lista.length;i++){%>
<option value="<%=lista[i].id%>">lista[i].titulo%></option>
</%}%>
</select>
</div>
<input type="submit" value="Cadastrar promoção"/>
</body>
</html>
Olha, eu vou tentar terminar o curso, mas tá dificil, eu não acho os erros, essas mensagens não ajudam, tem como capturar esses erros de uma forma mais legível?