My understanding of #13689, included in v6.12 is, that sequelize is not any more exported just in CommonJS, but can be used also as ESM-imports. Thus, the code in v6.11
import sequelize_ from 'sequelize'
const {DataTypes, Model, Op} = sequelize_ //this is CommonJS hack
can be changed in 6.12 to import {DataTypes, Model, Op} from 'sequelize'.
Typescript 4.5.4 fails on the above code with
$ node_modules/.bin/tsc
node_modules/sequelize/lib/operators.ts:524:1 - error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
524 export = Op;
~~~~~~~~~~~~
Found 1 error.
My understanding is, that Typescript is only supposed to verify the types in sequelize by parsing the code in the node_modules/sequelize/types directory, and not loose time to verify each file in node_modules/sequelize/lib/. But types/index.d.ts contains import * as Op from "../lib/operators"; so my assumption is not correct. Likewise for node_modules/sequelize/types/lib/model.d.ts:import * as Op from '../../lib/operators';
Bug Report Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
My understanding of #13689, included in v6.12 is, that sequelize is not any more exported just in CommonJS, but can be used also as ESM-imports. Thus, the code in v6.11
can be changed in 6.12 to
import {DataTypes, Model, Op} from 'sequelize'.Typescript 4.5.4 fails on the above code with
My understanding is, that Typescript is only supposed to verify the types in sequelize by parsing the code in the
node_modules/sequelize/typesdirectory, and not loose time to verify each file innode_modules/sequelize/lib/. Buttypes/index.d.tscontainsimport * as Op from "../lib/operators";so my assumption is not correct. Likewise fornode_modules/sequelize/types/lib/model.d.ts:import * as Op from '../../lib/operators';Bug Report Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?