Sequelize issue with Webpack. #16280
Labels
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
type: bug
Bug Description
Sequelize(6.32.1) associations issue when the application is built with Webpack
Reproducible Example
In my serverless.yml file, I have a plugin as below which helps in bundling my nodejs project with webpack:
In .js file, I have defined the association as below:
Below code snippet is failing with error : 'TypeError: r.addWorkOrder is not a function '
I tried to print savedAppt.countWorkOrders() to verify if other under-the-hood functions are working or not. But found the same error.
console.log("workorders:: ", savedAppt.countWorkOrders());
If I run the code locally without webpack bundling, then the code runs fine.
What do you expect to happen?
Association functions(addWorkOrders,countMasterCredTypes etc ) should work without any errors.
What is actually happening?
The code is failing with the below error after bundling the app with webpack.
TypeError: r.addWorkOrder is not a function
Environment
DEV, QA, STAGE
'npm list @sequelize/core'
Would you be willing to resolve this issue by submitting a Pull Request?
No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: