Versions
I'm submitting a ...
[ x] bug report
[ ] feature request
Actual behavior:
Unable to build project. See below for tsc output...
node_modules/sequelize-typescript/dist/sequelize/sequelize/sequelize.d.ts:12:5 - error TS2416: Property 'model' in type 'Sequelize' is not assignable to the same property in base type 'Sequelize'.
Type '(model: string | typeof Model) => typeof Model' is not assignable to type '(modelName: string) => ModelCtor<Model<any, any>>'.
Type 'typeof Model' is not assignable to type 'ModelCtor<Model<any, any>>'.
Type 'typeof Model' is not assignable to type 'new () => Model<any, any>'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
12 model(model: string | typeof Model): typeof Model;
Expected behavior:
I assume this should work. The documentation says sequelize v5 is supported. I have reverted back to sequelize v5.12.3 and all seems happy.
Steps to reproduce:
Upgrade to sequelize v5.13.0 and try to build.
I had a same issue. in my case I used sequelize-typescript@^1.0.0-beta.3, [email protected].
I don't know exact cause but I fixed this issue by changing [email protected] to [email protected] as I noticed sequelize-typescript@^1.0.0-beta.3 internally use [email protected]. I know this is temporary solution and hope this issue to be fixed asap
@zeroFruit I tried your solution but when using mssql dialect and hitting any of my endpoints it kept throwing some error from the connection-manager.js:
Unhandled rejection SequelizeConnectionError: Invalid arguments: "instanceName" must be a string
However with [email protected], [email protected], and [email protected] everything seems to function as intended. In my setup ts-node-dev ends up using ts-node version 8.3.0, typescript version 3.5.3 to server everything up.
@budhead2004
Hey @justinlottes, thanks for reporting. Just published a new beta version. ([email protected] or sequelize-typescript@next). Can you confirm that its working with this one?
It works on my side. Thanks @RobinBuschmann
Worked for me too.
Works for me. Thanks!
@RobinBuschmann I actually am having trouble getting this to work. I pulled the latest from sequelize-typescript@next and the thing is I can see in the code that interfaces/* should be exported via index.ts _but_ I'm not seeing it show up when I actually install the folder into my node_modules

Is it possible that not all folders (such as interfaces) are being properly exposed when you distribute the plugin?
@RobinBuschmann [email protected] solve compilation error ^^
I have the same issue with sequelize latest version ^6.3.3 that is published 10 days ago, where it is fine with older verions[^5.22.3].
It's 23/08/2020 for now I don't have problems with:
"sequelize": "^5.22.3",
"sequelize-typescript": "^1.0.0-beta.4"
All I have done to overlap this problem is to force the type of dialect to be the same of Dialect manually, like:
import { Dialect, Sequelize } from "sequelize";
new Sequelize(
...some configs,
{
...,
dialect: 'mysql' as Dialect
}
);
Most helpful comment
Hey @justinlottes, thanks for reporting. Just published a new beta version. (
[email protected]orsequelize-typescript@next). Can you confirm that its working with this one?