You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The call to Message.create fails with the following error.
The 'this' context of type 'typeof Message' is not assignable to method's 'this' of type '(new () => Message) & typeof Model'
I'm suffering from the fact that I'm not well versed in TypeScript and this error message is not transparent to me.
(new () => Message) seems to be the type signature that would describe a constructor/class that returns Message type objects. In which case, that should be satisfied by the fact that this is the Message class.
typeof Model which would presumably be equivalent to (new () => Model). I would have imagined that this was also satisfied because the Message class inherits from the model class.
I'm in the process of converting existing Sequelize code to TypeScript and so I expect that one of the abstractions already in place is tripping me up. Either way, it would be great to have a reference example of a typed model definition that includes these kind of methods.
Activity
felixfbecker commentedon Jul 8, 2017
What TS version?
danprince commentedon Jul 8, 2017
@felixfbecker Hope that helps.
felixfbecker commentedon Jul 8, 2017
There are bugs in 2.4.0. I corrected the
peerDependencyrange.See microsoft/TypeScript#16790