You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I cannot compile this example due to a type error:
index.ts(16,16): error TS2322: Type 'sequelize.Model<Thing, ThingInstance>' is not assignable to type 'sequelize.SequelizeStaticAndInstance.Model<Thing, ThingInstance>'.
Types of property 'scope' are incompatible.
Type '(options?: string | string[] | ScopeOptions | WhereOptions) => Model<Thing, ThingInstance>' is not assignable to type '(options?: string | string[] | ScopeOptions | WhereOptions) => this'.
Type 'Model<Thing, ThingInstance>' is not assignable to type 'this'.
This is probably related to microsoft/TypeScript#5863. Changing the return type of scope solves the error for me.
Of course, this is not a sufficient criterion for changing your code, but I believe that isn't working for anyone. Feedback about the correctness of this assumption is very welcome.
The text was updated successfully, but these errors were encountered:
louy
changed the title
Error casting sequelize.SequelizeStaticAndInstance.Model to sequelize.Model
Error casting SequelizeStaticAndInstance.Model to ModelJul 17, 2016
louy
changed the title
Error casting SequelizeStaticAndInstance.Model to Model
Error casting SequelizeStaticAndInstance.Model to Model
Jul 17, 2016
Interestingly, this only happens if you use import {Model, Instance} from 'sequelize'; instead of import * as Sequelize from 'sequelize';.
My guess is that it has something to do with the way we use export =. Could be related to microsoft/TypeScript#5863 but it's not the same issue.
Reported by @Thylossus in #14.
The text was updated successfully, but these errors were encountered: