Error: Model not initialized: "Model" needs to be added t o a Sequelize instance before "call" can be called. (Sequelize-typescript) Error: Model not initialized: "Model" needs to be added t o a Sequelize instance before "call" can be called. (Sequelize-typescript) typescript typescript

Error: Model not initialized: "Model" needs to be added t o a Sequelize instance before "call" can be called. (Sequelize-typescript)


Remove constructor call from model

import {Table, Model, Column, DataType} from 'sequelize-typescript'@Tableexport class Author extends Model<Author> {  // constructor(){  //     super();  // }  @Column(DataType.STRING)  fname: string  @Column(DataType.STRING)  lname: string}

You cannot use constructor as it's used by sequelize for internal things

source


Changing target: "es5" to target: "es6" helped me solve this issue. It is not documented but it is present in the example provided.