Skip to content

SequelizeEagerLoadingError on AWS Lambda with Webpack #12874

Closed

Description

@AwolDes

Issue Description

After porting over an express & sequelize API to serverless, I am running into the following error for any association I have (queries without associations work fine).

[SequelizeEagerLoadingError]: Model A is not associated to Model B!

What are you doing?

PoC repo here: https://github.com/AwolDes/express-sequlize-lambda-webpack-poc

curl localhost:4000/dev/organisations/1/users will trigger the bug.

The database relations have the correct information (using sequelize.sync)

image
image

What do you expect to happen?

I want the associations to work correctly with webpack & lambda.

What is actually happening?

Currently I am receiving the error

EagerLoadingError [SequelizeEagerLoadingError]: user is not associated to organisation!

Environment

  • Sequelize version: 5.21.13
  • Node.js version: 12.19.1
  • Operating System: Ubtunu 18.04

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.

Activity

  1. papb commented on Apr 4, 2021

    @papb
    Member

    Hello! Thanks for creating a PoC repo. Can you clarify what you mean by Local DB config required (from your readme)? Let's get this fixed!!

    Can you also please take a look at #13169?

  2. added
    status: awaiting response
    on Apr 4, 2021
  3. AwolDes commented on Apr 4, 2021

    @AwolDes
    Author

    Thanks @papb! By that I mean you will need to run a postgres db locally (I didn't include a docker image in the PoC repo)

  4. removed
    status: awaiting response
    on Apr 4, 2021
  5. github-actions commented on Oct 28, 2021

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions