question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript 4.8.2 does not like the type definitions from sequelize 6.21.4

See original GitHub issue

Upgrading 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
WikiRikcommented, Aug 26, 2022

Thanks for letting us know! We have not looked into TypeScript 4.8 support yet, but it will land in the next release.

0reactions
github-actions[bot]commented, Sep 18, 2022

🎉 This issue has been resolved in version 7.0.0-alpha.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found