Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

(node: 6496) UnhandçedPromiseRejectionWarning

Olá, não consigo passar da aula 2.2 devido ao seguinte erro. Fiz o download do projeto da aula 2 no github , porém infelizmente o erro persiste:

node api/index.js A API está funcionando! Executing (default): INSERT INTO fornecedores (id,em presa,email,categoria,dataCriacao,dataAtualizacao,versao) VALUES (DEFAULT,?,?,?,?,?,?); (node:21752) UnhandledPromiseRejectionWarning: SequelizeD atabaseError: Data truncated for column 'categoria' at ro w 1 at Query.formatError (C:\Users\ganga\Documents\Github \Alura\api-petshop\node_modules\sequelize\lib\dialects\my sql\query.js:239:16) at Query.run (C:\Users\ganga\Documents\Github\Alura\a pi-petshop\node_modules\sequelize\lib\dialects\mysql\quer y.js:54:18) at processTicksAndRejections (internal/process/task_q ueues.js:93:5) at async C:\Users\ganga\Documents\Github\Alura\api-pe tshop\node_modules\sequelize\lib\sequelize.js:619:16 at async MySQLQueryInterface.insert (C:\Users\ganga\D ocuments\Github\Alura\api-petshop\node_modules\sequelizelib\dialects\abstract\query-interface.js:734:21) at async model.save (C:\Users\ganga\Documents\GithubAlura\api-petshop\node_modules\sequelize\lib\model.js:393 9:35) at async Function.create (C:\Users\ganga\Documents\Gi thub\Alura\api-petshop\node_modules\sequelize\lib\model.j s:2195:12) at async Fornecedor.criar (C:\Users\ganga\Documents\G ithub\Alura\api-petshop\api\rotas\fornecedores\Fornecedor .js:15:27) at async C:\Users\ganga\Documents\Github\Alura\api-pe tshop\api\rotas\fornecedores\index.js:15:5 (Use node --trace-warnings ... to show where the warnin g was created) (node:21752) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwi ng inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch( ). To terminate the node process on unhandled promise rej ection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_reject ions_mode). (rejection id: 1) (node:21752) [DEP0018] DeprecationWarning: Unhandled prom ise rejections are deprecated. In the future, promise rej ections that are not handled will terminate the Node.js p rocess with a non-zero exit code.

1 resposta
solução!

Consegui resolver removendo o MySQL da máquina e instalando novamente

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software