'isInitialized' of undefined association problem.
See original GitHub issueLooks like that when we try to put an association of model B.model.ts on an A.model.ts results in the following error:
TypeError: Cannot read property 'isInitialized' of undefined
/node_modules/sequelize-typescript/lib/models/association/BaseAssociation.js:19
if (!modelClass.isInitialized) {
^
TypeError: Cannot read property 'isInitialized' of undefined
at BelongsToAssociation.BaseAssociation.getAssociatedClass (/node_modules/sequelize-typescript/lib/models/association/BaseAssociation.js:19:25)
The file os model names must be ordered by his association as well ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
'isInitialized' of undefined association problem. #357 - GitHub
Looks like that when we try to put an association of model B.model.ts on an A.model.ts results in the following error: TypeError: Cannot...
Read more >node.js - Sequelize Association Error Cannot read property ...
I have a one-to-one relationship between the tables and am not sure if this is causing the error or if it is somewhere...
Read more >Class Model<TModelAttributes, TCreationAttributes> Abstract
A dummy variable that doesn't exist on the real object. This exists so Typescript can infer the type of the attributes in static...
Read more >Link - Troubleshooting | Plaid Docs
Make sure Link is initialized for the country in which the institution operates. If the problem occurs in Production but not in Sandbox...
Read more >Hibernate ORM 5.4.33.Final User Guide - Red Hat on GitHub
Use Hibernate and report any bugs or issues you find. ... While the java.sql classes define a direct association to the SQL ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just ran into the same issue. Thanks @Mreddi1 for pointing me in the right direction. I just want to add a little info for the next person who comes here looking for answers. In my case I was importing the association via
import { AssociatedModel } from "../models"
where models is a module that imports and reexports all my models. The fix for me was to useimport { AssociatedModel } from "./AssociatedModel"
. Guess it’s something about the indirect import?The errorhandling could be better. A wrong import caused my problem.