Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequelize error: Unhandled rejection TypeError: Cannot read property '_pseudo of undefined

I am cloned this app https://github.com/sequelize/express-example which appears to be the official sequelize express example but I get this error when I try to run it

Unhandled rejection TypeError: Cannot read property '_pseudo' of undefined at conformInclude (/Users/wasswasam/express-example-master/node_modules/sequelize/lib/model.js:277:14)

I am not sure what's going on.

like image 445
Wasswa Samuel Avatar asked Jan 22 '17 11:01

Wasswa Samuel


2 Answers

I'm not sure myself but I do encounter this problem before. And I managed to solve this by removing the include param for findAll function

models.User.findAll({
    include: [ models.Task ]
  })

to

models.User.findAll()

The only think I can think is that you does not have the model it need. Hope this help.

like image 98
Muhammad Azizol Aminuddin Avatar answered Nov 15 '22 15:11

Muhammad Azizol Aminuddin


I get this error when the object in the include array is undefined. Usually caused by a dependency loop or a misspelled import.

like image 36
Russbear Avatar answered Nov 15 '22 14:11

Russbear