Skip to content

Fix issue with ES Express import#310

Merged
adamjmcgrath merged 1 commit intomasterfrom
fix-express-import
May 20, 2022
Merged

Fix issue with ES Express import#310
adamjmcgrath merged 1 commit intomasterfrom
fix-express-import

Conversation

@adamjmcgrath
Copy link
Copy Markdown
Contributor

Description

Use import = require() syntax to import a CommonJS style export = type from @types/express

References

fixes #309
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express/index.d.ts
https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require

Testing

I'd like to remove the esModuleInterop flag from https://github.com/auth0/node-jwks-rsa/blob/master/tsconfig.json#L16 so our CI tests would verify this, but I can't because out express-jwt dependencies require this. So tested manually with basic TS config.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@adamjmcgrath adamjmcgrath added the review:small Small review label May 17, 2022
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner May 17, 2022 11:13
@rbutera
Copy link
Copy Markdown

rbutera commented May 19, 2022

lets get this merged, latest release is breaking all of our nodejs auth0 apps

@adamjmcgrath adamjmcgrath merged commit a3b26e2 into master May 20, 2022
@adamjmcgrath adamjmcgrath deleted the fix-express-import branch May 20, 2022 09:49
@adamjmcgrath adamjmcgrath mentioned this pull request May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:small Small review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants