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
Typescript 4.5.4 does not like sequelize-ESM imports in v6.12 #13791
Comments
@ephys can you take a look at this? |
I'm having this issue also since the 6.12 release Changing |
@WikiRik Yep! I'll look into this :) |
Release 6.12.1 should fix this as we've reverted to the previous import style. If it does not, my recommendation would be to use the skipLibCheck option until we migrate to esm import/exports in v7 |
Still getting the error on 6.12.1 even with skipLibCheck, I'll just revert to 6.11 for now and wait for the full v7 release |
@shoeyn can you post your tsconfig.json? |
{ // edit: This is after removing skiplibcheck again and removing all sorts of paths |
I have the same problem. On the server, my project compiles the Docker and it uses the latest version. Because of this, I can't unload a very important fix In my tsconfig.json skipLibCheck is true Locally, I solved this problem like this: For some reason I can't use the previous version, the latest one is being downloaded |
@Papa2Carlro In your package.json make sure to have sequelize as: |
This is annoying.
Although, If I do
it works (for as long as its transpiled to commonjs). |
🎉 This issue has been resolved in version 6.12.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Can you give it a try and reopen if still an issue? |
Now it works. Github does not allow the reporter to reopen issues, which were not closed by the reporter. |
ah :) but all good? |
|
Hi. I'm debugging unit tests that were failing due to a "@@" operator, and I see the whole QueryGenerator.OperatorMap is reduced to
Not sure if this is expected. |
Hi @ephys Version |
Good catch, we'll do that :) |
esbuild version has been locked https://github.com/sequelize/sequelize/pull/13836/files |
This is also part of the latest release (v6.12.4) |
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/types
directory, and not loose time to verify each file innode_modules/sequelize/lib/
. Buttypes/index.d.ts
containsimport * 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?
The text was updated successfully, but these errors were encountered: