Typescript 4.8.2 does not like the type definitions from sequelize 6.21.4
See original GitHub issueUpgrading to Typescripte 4.8.2 and running tsc prints on my system:
node_modules/sequelize/types/hooks.d.ts:69:19 - error TS2344: Type 'TAttributes' does not satisfy the constraint '{}'.
69 M extends Model<TAttributes, TCreationAttributes> = Model,
~~~~~~~~~~~
node_modules/sequelize/types/hooks.d.ts:70:3
70 TAttributes = any,
~~~~~~~~~~~~~~~~~
This type parameter might need an `extends {}` constraint.
node_modules/sequelize/types/model.d.ts:3252:105 - error TS2344: Type 'TModelAttributes' does not satisfy the constraint '{}'.
3252 export type ModelType<TModelAttributes = any, TCreationAttributes = TModelAttributes> = new () => Model<TModelAttributes, TCreation
Attributes>;
~~~~~~~~~~~~~~~~
node_modules/sequelize/types/model.d.ts:3252:23
3252 export type ModelType<TModelAttributes = any, TCreationAttributes = TModelAttributes> = new () => Model<TModelAttributes, TCrea
tionAttributes>;
~~~~~~~~~~~~~~~~~~~~~~
This type parameter might need an `extends {}` constraint.
node_modules/sequelize/types/model.d.ts:3260:52 - error TS2344: Type 'S' does not satisfy the constraint '{}'.
3260 export type ModelDefined<S, T> = ModelStatic<Model<S, T>>;
~
node_modules/sequelize/types/model.d.ts:3260:26
3260 export type ModelDefined<S, T> = ModelStatic<Model<S, T>>;
~
This type parameter might need an `extends {}` constraint.
As these errors do not reference my files, I assume that the files with type definitions exported by sequelize 6.21.4 are not good.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
TypeScript - Sequelize
Sequelize Models accept two generic types to define what the model's Attributes & Creation Attributes are like: import { Model, Optional } from ......
Read more >called with something that's not a subclass of sequelize.model ...
I am already try: Adding user.hasMany before the belongsTo; Determine export class User extends Model (without implement IUser); user.associate = (models) => ...
Read more >sequelize-typescript - npm
Start using sequelize-typescript in your project by running `npm i sequelize-typescript`. There are 544 other projects in the npm registry ...
Read more >sequelize: Versions - Openbase
exports types to support typescript >= 4.5 nodenext module (#14620) (cbdf73e) ... dialect: sequelize pool doesn't take effect in dialect "mssql" (#13880) ...
Read more >Compiling error sequelize-typescript but works with nodemon
Not sure what's causing this (maybe your Typescript version is incompatible with this sequelize version?) Perhaps adding skipLibCheck: true ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for letting us know! We have not looked into TypeScript 4.8 support yet, but it will land in the next release.
🎉 This issue has been resolved in version 7.0.0-alpha.17 🎉
The release is available on:
Your semantic-release bot 📦🚀