Skip to content

models in sequelize constructor or in include relations ts error. #826

Closed
@ahmedthinkdifferent

Description

@ahmedthinkdifferent

i have user model :-
import { Column, Model, Table } from 'sequelize-typescript';

@table({
tableName: 'users',
})
export class User extends Model {
@column
name: string;

@column
age: number;

}

TS2322: Type 'typeof User' is not assignable to type 'string | ModelCtor<Model<any, any>>'.   Type 'typeof User' is not assignable to type 'ModelCtor<Model<any, any>>'.     Type 'typeof User' is not assignable to type 'typeof Model'.       Construct signature return types 'User' and 'Model<T, T2>' are incompatible.         The types of '_attributes' are incompatible between these types.           Type 'User' is not assignable to type 'T'.             'T' could be instantiated with an arbitrary type which could be unrelated to 'User'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions