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

Unable to start the server because Sequelize V6 is not yet supported by sequelize-typescript #31

Closed
avtarnanrey opened this issue Jul 14, 2020 · 1 comment · Fixed by #39

Comments

@avtarnanrey
Copy link

This starter repository is not working anymore because of a recent major release of Sequelize V6. We are getting the following error:

TSError: ⨯ Unable to compile TypeScript:
src/models/index.model.ts(25,22): error TS2769: No overload matches this call.
  The last overload gave the following error.
    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'.

    at createTSError (D:\___\code\api\node_modules\ts-node\src\index.ts:434:12)
    at reportTSError (D:\___\code\api\node_modules\ts-node\src\index.ts:438:19)
    at getOutput (D:\___\code\api\node_modules\ts-node\src\index.ts:578:36)
    at Object.compile (D:\___\code\api\node_modules\ts-node\src\index.ts:775:32)
    at Module.m._compile (D:\___\code\api\node_modules\ts-node\src\index.ts:858:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Object.require.extensions.<computed> [as .ts] (D:\___\code\api\node_modules\ts-node\src\index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
[nodemon] app crashed - waiting for file changes before starting...

sequelize-typescript is not yet upgraded to support Sequelize V6.
I think this one is the WIP: sequelize/sequelize-typescript#804

@avtarnanrey
Copy link
Author

The workaround for this right now is to downgrade the last v5 version of "sequelize": "^5.22.2",.
https://github.com/sequelize/sequelize/releases/tag/v5.22.2

@ljlm0402 ljlm0402 linked a pull request Nov 5, 2020 that will close this issue
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.

1 participant