title: SequelizeEagerLoadingError: Role is not associated to User
body: <p>I am using Sequelize with MYSQL and express.
  I am getting  <strong>SequelizeEagerLoadingError: Role is not associated to User</strong> when trying to select data from related models using include. </p>
  
  <p>I am having two models, User and Role. A user belongsToMany Roles through RoleUser and a Role belongsToMany users through RoleUser. Here are my models:</p>
  
  <p><strong>//User Model</strong></p>
  
  <pre><code>'use strict';
  
  module.exports = (sequelize, DataTypes) =&gt; {
    const User = sequelize.define('User', {
      id: {type:DataTypes.UUID,allowNull:false,unique:true,primaryKey:true},
      UserName: {type:DataTypes.STRING,unique:true,allowNull:false},
       Email: {type:DataTypes.STRING,allowNull:false,unique:true,validate: { isEmail: {msg: "Invalid Email"} }},
      Password: {type:DataTypes.STRING,allowNull:false},
  
    }, {});
    User.associate = function(models) {
  
  
          User.belongsToMany(models.Role,
              {
          through: 'RoleUser',
          foreignkey:'UserId'
  
      })
  
  
  
  
   };
    return User;
  };
  
  //Role Model
  'use strict';
  module.exports = (sequelize, DataTypes) =&gt; {
    const Role = sequelize.define('Role', {
      id: {type:DataTypes.UUID,allowNull:false,unique:true,primaryKey:true},
      Name: DataTypes.STRING,
      Description: DataTypes.STRING
    }, {});
    Role.associate = function(models) {
      Role.belongsToMany(models.User,
          {
              through:'RoleUser',
              foreignKey:'RoleId'
  
          }),
  
  
    };
    return Role;
  };
  
  //My query on user model
  
  xports.index = function(req, res) {
    return User.findAll({ 
            include: [{
            model: Role,
  
          }],
  
      attributes:{
          exclude: ['Password','createdAt','updatedAt']
  
      }}).then((users)=&gt;{
      console.log(users)
      }).catch(error=&gt;{
      console.log(error);
      })
  </code></pre>
  
  <p><strong>//ERROR</strong></p>
  
  <pre><code> SequelizeEagerLoadingError: Role is not associated to User!
  
   **STATUS CODE: 200(OK)**
  
   I am getting same error in other models in the entire project. According to me the associations is correctly established and I can see in the PHPMyAdmin Relation View.
  
   *Express Version: 4.16.4
   Sequelize Version: 4.31.2
   Mysql2 version: 1.6.1*
  
   Any help. What am I doing wrong.
  </code></pre>