sequalize类型“ void”不能分配给类型“ Model <any,any>”

时间:2020-10-29 17:47:56

标签: sequelize.js sequelize-typescript

我有一个实体

@Table({tableName: 'EducationEntity'})
export class EducationEntity extends Model<EducationEntity> {

}

我正在尝试做:EducationEntity.build(plainObject as any);从普通对象构建模型。

我遇到了错误:

src/research/research.service.ts:165:51 - error TS2684: The 'this' context of type 'typeof EducationEntity' is not assignable to method's 'this' of type '(new () => EducationEntity) & typeof Model'.
  Type 'typeof EducationEntity' is not assignable to type 'typeof Model'.
    The types returned by 'init(...)' are incompatible between these types.
      Type 'void' is not assignable to type 'Model<any, any>'.

那是什么,EducationEntity是一个模型?

Thakns

0 个答案:

没有答案