-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 2.7.1 and 2.8.0-dev.20180211
Search Terms:
is not a constructor function type
is not a constructor function type esModuleInterop
is not a constructor function type module Interop
Code
I am using https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hapi for typing hapi 17
It works fine until I enable the new esModuleInterop then suddenly I get this error
node_modules/@types/hapi/definitions/server/server.d.ts:45:29 - error TS2507: Type '{ default: Podium; registerEvent(events: Events[]): void; registerEvent(events: Events): void; re...' is not a constructor function type.
45 export class Server extends Podium {
Expected behavior:
I believe the definition file should either be valid or not regardless of if esModuleInterop is enabled or not
Actual behavior:
If the type definition is invalid code and then should error either way. If it is valid code then it should not error either way.
Also if I //@ts-ignore the error the code compiles and runs fine
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript