question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript 2.7.2 constructor function

See original GitHub issue

Got 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
RobinBuschmanncommented, Mar 22, 2018

@sanewell92 thanks for creating the example repo. The compiler option esModuleInterop is causing this error. This is because esModuleInterop: true requires exports like export = to be imported with import 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 set skipLibCheck: 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.

1reaction
junior-alescommented, Apr 7, 2018

I’ve spent a good amount of time dealing with this compilation error of SequelizeOrigin in Sequelize class. Maybe we could add something on the installation instructions about the esModuleInterop option, I’m up for opening a PR if you think it is appropriate @RobinBuschmann.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found