{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21872","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21872/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21872/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21872/events","html_url":"https://github.com/Microsoft/TypeScript/issues/21872","id":296227059,"number":21872,"title":"esModuleInterop causes is not a constructor function type","user":{"login":"corbinu","id":533625,"avatar_url":"https://avatars0.githubusercontent.com/u/533625?v=4","gravatar_id":"","url":"https://api.github.com/users/corbinu","html_url":"https://github.com/corbinu","followers_url":"https://api.github.com/users/corbinu/followers","following_url":"https://api.github.com/users/corbinu/following{/other_user}","gists_url":"https://api.github.com/users/corbinu/gists{/gist_id}","starred_url":"https://api.github.com/users/corbinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corbinu/subscriptions","organizations_url":"https://api.github.com/users/corbinu/orgs","repos_url":"https://api.github.com/users/corbinu/repos","events_url":"https://api.github.com/users/corbinu/events{/privacy}","received_events_url":"https://api.github.com/users/corbinu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-11T21:24:14Z","updated_at":"2018-02-12T02:29:25Z","closed_at":null,"author_association":"NONE","body":"<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:**  2.7.1 and 2.8.0-dev.20180211\r\n\r\n<!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** \r\nis not a constructor function type\r\nis not a constructor function type esModuleInterop\r\nis not a constructor function type module Interop\r\n\r\n**Code**\r\nI am using https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hapi for typing hapi 17\r\n\r\nIt works fine until I enable the new esModuleInterop then suddenly I get this error\r\n```\r\n\r\nnode_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.\r\n\r\n45 export class Server extends Podium {\r\n```\r\n\r\n**Expected behavior:**\r\nI believe the definition file should either be valid or not regardless of if esModuleInterop is enabled or not\r\n\r\n**Actual behavior:**\r\nIf the type definition is invalid code and then should error either way. If it is valid code then it should not error either way.\r\n\r\nAlso if I //@ts-ignore the error the code compiles and runs fine\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/364815853","html_url":"https://github.com/Microsoft/TypeScript/issues/21872#issuecomment-364815853","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21872","id":364815853,"user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars2.githubusercontent.com/u/972891?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T02:29:25Z","updated_at":"2018-02-12T02:29:25Z","author_association":"MEMBER","body":"[Since Podium is a CommonJS module that is declared with an `export =`, you need to import it with `import Podium = require(\"podium\")` or `import Podium from \"podium\"`"}}
{"actor":{"display_login":"DanielRosenwasser"}}