Here is a repo with the reproduction: https://github.com/david-guevara-gorillalogic/mailosaur-esm-issue. ## Reproduction steps 1. Clone https://github.com/david-guevara-gorillalogic/mailosaur-esm-issue 2. Execute `pnpm install` 3. Execute `pnpm run check` (i.e. `tsc --noEmit`) 4. See the type error. ## Expected result TypeScript should compile without errors. ## Current result ``` TS2351: This expression is not constructable. Type 'typeof import(".../node_modules/mailosaur/cjs/mailosaur")' has no construct signatures. ``` ## Details The code is essentially: ```typescript import MailosaurClient from "mailosaur"; const client = new MailosaurClient("not-a-real-api-key"); ``` With this tsconfig: ```json { "compilerOptions": { "module": "NodeNext" } } ```
Here is a repo with the reproduction: https://github.com/david-guevara-gorillalogic/mailosaur-esm-issue.
Reproduction steps
pnpm installpnpm run check(i.e.tsc --noEmit)Expected result
TypeScript should compile without errors.
Current result
Details
The code is essentially:
With this tsconfig:
{ "compilerOptions": { "module": "NodeNext" } }