Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ahmedthinkdifferent opened this issue Aug 17, 2020 · 2 comments · Fixed by #900
Closed

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

ahmedthinkdifferent opened this issue Aug 17, 2020 · 2 comments · Fixed by #900

Comments

@ahmedthinkdifferent
Copy link

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'.

@Segfaultd
Copy link

Same here. Looks like it's not compatible with latest version of sequelize. Works fine with the 5.21.7

@techird
Copy link

techird commented Jan 5, 2021

thanks @Segfaultd , fixed after install sequelize@5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants