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

Compile errors with latest sequelize and typescript #1412

Closed
spinlud opened this issue Sep 3, 2022 · 1 comment
Closed

Compile errors with latest sequelize and typescript #1412

spinlud opened this issue Sep 3, 2022 · 1 comment

Comments

@spinlud
Copy link

spinlud commented Sep 3, 2022

It seems there are some issues compiling with latest sequelize and typescript libs:

npx tsc

node_modules/sequelize-typescript/dist/model/model/model.d.ts:7:131 - error TS2344: Type 'TModelAttributes' does not satisfy the constraint '{}'.

7 export declare type ModelType<TCreationAttributes, TModelAttributes> = new (values?: TCreationAttributes, options?: any) => Model<TModelAttributes, TCreationAttributes>;
                                                                                                                                    ~~~~~~~~~~~~~~~~

  node_modules/sequelize-typescript/dist/model/model/model.d.ts:7:52
    7 export declare type ModelType<TCreationAttributes, TModelAttributes> = new (values?: TCreationAttributes, options?: any) => Model<TModelAttributes, TCreationAttributes>;
                                                         ~~~~~~~~~~~~~~~~
    This type parameter might need an `extends {}` constraint.

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, TCreationAttributes>;
                                                                                                             ~~~~~~~~~~~~~~~~

  node_modules/sequelize/types/model.d.ts:3252:23
    3252 export type ModelType<TModelAttributes = any, TCreationAttributes = TModelAttributes> = new () => Model<TModelAttributes, TCreationAttributes>;
                               ~~~~~~~~~~~~~~~~~~~~~~
    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.


Found 4 errors in 3 files.

Errors  Files
     1  node_modules/sequelize-typescript/dist/model/model/model.d.ts:7
     1  node_modules/sequelize/types/hooks.d.ts:69
     2  node_modules/sequelize/types/model.d.ts:3252

node: 12.22.12
typescript: 4.8.2
sequelize: 6.21.4
sequelize-typescript: 2.1.3
reflect-metadata: 0.1.13
@types/validator: 13.7.6
@types/node: 18.7.14

@WikiRik
Copy link
Member

WikiRik commented Sep 3, 2022

We're tracking this in sequelize/sequelize#14934

@WikiRik WikiRik closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2022
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

No branches or pull requests

2 participants