Revisit: Invalid Scope Called (#388)
I'm running into the same issue referenced by the old #388 issue.
Is there any chance this could be revisited?
It seems like this issue shouldn't need to exist. Perhaps back then, there were more limitations in Sequelize. As of today, though, the Sequelize code uses Toposort after initialization of the models to sort them by dependencies (associations) prior to executing tasks that require the proper order of models loading. It seems like a simple sort after defining the models, before associating them, could fix this issue.
https://github.com/sequelize/sequelize-typescript/blob/9baa5845123ff14ae641892d8d8cdebeb7612cf2/src/sequelize/sequelize/sequelize.ts#L52-L53
Originally posted by @dever23b in https://github.com/sequelize/sequelize-typescript/issues/388#issuecomment-1237580328