DEV Community

Discussion on: Using ES6 classes for Sequelize 4 models

Collapse
 
imsergiobernal profile image
Sergio • Edited

Hello! It is not possible to use super.init() using TypeScript.

class Model<T = any, T2 = any>

The 'this' context of type 'typeof Model' is not assignable to method's 'this' of type 'ModelCtor<Model<unknown, unknown>>'.
  Type 'typeof Model' is not assignable to type 'new () => Model<unknown, unknown>'.
    Cannot assign an abstract constructor type to a non-abstract constructor type.ts(2684)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
64j0 profile image
Vinícius Gajo

You can try using the this.init inside the static method