Typescript 2.7.2 constructor function
See original GitHub issueGot an error, originating from the sequelize type definitions.
node_modules/sequelize-typescript/lib/models/Sequelize.d.ts(7,40):
error TS2507:
Type '{
default: SequelizeStatic;
cls: any;
useCLS(namespace: Namespace): Sequelize;
Utils: Utils;
Prom...'
is not a constructor function type.
Coming from Sequelize.d.ts
.
Anyone else getting this error? I’m using typescript 2.7.2 on an Ubuntu machine.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Typescript 2.7.2 constructor function · Issue #330 - GitHub
Got an error, originating from the sequelize type definitions. node_modules/sequelize-typescript/lib/models/Sequelize.d.ts(7,40): error ...
Read more >Documentation - TypeScript 2.7
This flag performs checks to ensure that each instance property of a class gets initialized in the constructor body, or by a property...
Read more >Announcing TypeScript 2.7 - Microsoft Developer Blogs
This flag makes sure that each instance property of a class gets set in the constructor body, or by a property initializer.
Read more >Strict Class Initialization in Typescript 2.7 - Stack Overflow
You should define the field as being optional, as there will be a time interval between the constructor call and until you get...
Read more >Using TypeScript with ArcGIS API for JavaScript - Esri
Using TypeScript with the ArcGIS API for. JavaScript ... function setSize(v: number | string) { ... Or, use esModuleInterop with typescript 2.7.2 ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sanewell92 thanks for creating the example repo. The compiler option
esModuleInterop
is causing this error. This is becauseesModuleInterop: true
requires exports likeexport =
to be imported withimport target from 'source'
. Since the sequelize typings use this format (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/sequelize/index.d.ts#L6620) it is throwing this error. So for now, either omit that compiler option (esModuleInterop
) or setskipLibCheck: true
(see https://www.typescriptlang.org/docs/handbook/compiler-options.html).But for the long term I will need to investigate this a little bit more and check how I will proceed with this issue.
I’ve spent a good amount of time dealing with this compilation error of
SequelizeOrigin
inSequelize
class. Maybe we could add something on the installation instructions about theesModuleInterop
option, I’m up for opening a PR if you think it is appropriate @RobinBuschmann.