Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Include unexpected. Element has to be either a Model, an Association or an object. #11685

Closed
2 of 7 tasks
jy95 opened this issue Nov 16, 2019 · 72 comments
Closed
2 of 7 tasks

Comments

@jy95
Copy link

jy95 commented Nov 16, 2019

Issue Description

I am trying to make a big query with many joins and it seems sequelize doesn't like the way I am doing this.

What are you doing?

const ids = [/*Some integer here*/];
models.Exercise.findAll({
  // no need for that part here
  attributes: [
    "id",
    "title",
    "description",
    "version",
    "createdAt",
    "updatedAt"
  ],
  where: {
    id: {
      [Op.in]: ids
    }
  },
  include: [
    // load exercise evaluation
    {
      models: models.Exercise_Metrics,
      as: "metrics",
      attributes: [
        ["vote_count", "votes"],
        ["avg_vote_score", "avg_vote"]
      ]
    },
    // load tags linked to this exercise ( with their category included )
    {
      models: models.Exercise_Tag,
      as: "tags",
      attributes: [],
      include: [
        {
          models: models.Tag,
          attributes: ["id", "text"],
          include: [
            {
              models: models.Tag_Category,
              as: "category",
              attributes: [
                ["kind", "category"],
                ["id", "category_id"]
              ]
            }
          ]
        }
      ]
    }
  ]
});

What do you expect to happen?

I expect that to work when I use findAll

What is actually happening?

Error: Include unexpected. Element has to be either a Model, an Association or an object.
    at Function._conformInclude (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:390:11)
    at options.include.options.include.map.include (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:326:59)
    at Array.map (<anonymous>)
    at Function._conformIncludes (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:326:39)
    at Function._baseMerge (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:791:10)
    at Function._defaultsOptions (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:828:17)
    at Function._injectScope (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:3288:10)
    at Promise.try (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:1707:12)
    at tryCatcher (D:\workspaceshit\exercises_library\node_modules\bluebird\js\release\util.js:16:23)
    at Function.Promise.attempt.Promise.try (D:\workspaceshit\exercises_library\node_modules\bluebird\js\release\method.js:39:29)
    at Function.findAll (D:\workspaceshit\exercises_library\node_modules\sequelize\lib\model.js:1706:23)

Additional context

Here are my models definitions if It could help you :
Exercise
Exercise_Metrics
Exercise_Tag
Tag
Tag_Category

Environment

  • Sequelize version: 5.21.2
  • Node.js version: v10.16.0
  • Operating System: Windows 10

Issue Template Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
@jy95
Copy link
Author

jy95 commented Nov 16, 2019

I made a typo : models instead of model
Sorry for the issue

@jy95 jy95 closed this as completed Nov 16, 2019
@JasmineGe
Copy link

JasmineGe commented Dec 11, 2019

Hi so it's caused by your typo? I also have this issue, but don't know why :(

@papb
Copy link
Member

papb commented Jan 16, 2020

@JasmineGe did you figure it out?

@aky6
Copy link

aky6 commented Feb 25, 2020

same issue

@abid1208
Copy link

Same issue

@Neulhan
Copy link

Neulhan commented May 24, 2020

same issue

@sajeell
Copy link

sajeell commented Jun 16, 2020

Same Issue

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

21 similar comments
@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

25 similar comments
@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@martinnaughton
Copy link

I had the issue but it was because i did not use the proper name for the model name use that i defined it as

in my model i defined it as sequelize.define('houseLocation'

and in query i had lower "l"

include: [
          {
            model: db.houselocation,
            required: true
          }
        ],

Once i used the correct case as I had in the in model then it work. Check the name you gave it in the define bit in the model and check your case

include: [
          {
            model: db.houseLocation,
            required: true
          }
        ],

@snwfdhmp
Copy link

snwfdhmp commented Feb 10, 2021

I just had the same issue and double checked the name of my models. They were wrong. This solved my issue.

@bl4ckck
Copy link

bl4ckck commented Mar 2, 2021

@jy95 thanks, you saved my time with simple 'as' property

include: [{model: Products, as: 'products', attributes: ['name_product']}],

@rajgohil07
Copy link

i also make same typo anyway thanks

@Saqib-diar
Copy link

I also make same typo, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests