Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Typescript error Module can only be default-imported using the 'esModuleInterop' flag #309

Closed
nickgvt opened this issue May 13, 2022 · 2 comments · Fixed by #310
Closed

Comments

@nickgvt
Copy link

nickgvt commented May 13, 2022

Describe the problem

There was a recent patch release for types change in index.d.ts file, which is causing as error:

TS 1259: Module '"/node_modules/@types/express/index"' can only be default-imported using the 'esModuleInterop' flag
4 import Express from 'express'
         ~~~~~~~

  node_modules/@types/express/index.d.ts:133:1
    133 export = e;
        ~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

This seems to be related to #305

Expected behavior

I would like to be able to build my project without needing to add a typescript flag and change all my existing imports

Reproduction

This tsconfig file looks like this

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "ES2019",
    }
}

Environment

  • jwks-rsa v 2.1.2
  • typescript 4.x
  • node 16
@maplesteve
Copy link

Our builds are also failing since v2.1.2 due to the change in #305.

@kirillgroshkov
Copy link

Same for us. Pinned to 2.1.1 until it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants