EagerLoadingError [SequelizeEagerLoadingError]: Users is not associated to UserGroups! #58198
Unanswered
rushabhT3
asked this question in
Programming Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Body
I’m trying to query my UserGroups model and include the associated Users model using Sequelize. However, I keep getting the error EagerLoadingError [SequelizeEagerLoadingError]: Users is not associated to UserGroups!. I have defined the associations between my models as follows:
And here is the code for my getGroupDetail function where I’m trying to query the UserGroups model and include the Users model:
I have checked that the file where I define the associations is being imported and executed before I run this function. However, I’m still getting the error. Can anyone help me figure out what might be causing this issue?
this is also showing
{ Messages: Messages, Groups: Groups } {}meaning that there is no association with the UserGroupM for anything. I have imported things correctly
Guidelines
All reactions