auth0 / express-jwt

connect/express middleware that validates a JsonWebToken (JWT) and set the req.user with the attributes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Turning on esModuleInterop is a breaking change

matray opened this issue · comments

Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Description

Provide a clear and concise description of the issue, including what you expected to happen.

The following commit turns on esModuleInterop for this project, making all others that depend on it require the same changes and breaking builds or requiring in a refactor of code that breaks when turning it on.

Depending on 8.3.0 now spits out:

node_modules/express-jwt/dist/index.d.ts:1:8 - error TS1192: Module '"/Users/matray/<blah blah>/node_modules/@types/jsonwebtoken/index"' has no default export.

1 import jwt from 'jsonwebtoken';
         ~~~


Found 1 error in node_modules/express-jwt/dist/index.d.ts:1

I believe this commit should not have been considered a minor change and ideally, there should be no need for esModuleInterop.

Reproduction

Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.

Where applicable, please include:

  • Code sample to reproduce the issue
  • Log files (redact/remove sensitive information)
  • Application settings (redact/remove sensitive information)
  • Screenshots

Environment

Please provide the following:

  • Version of this library used:
  • Version of the platform or framework used, if applicable:
  • Other relevant versions (language, server software, OS, browser):
  • Other modules/plugins/libraries that might be involved:

Same issue here. I had to keep going with ~8.2.1, which has the jsonwebtoken > 9.

Thank you for reporting this and sorry about that, I just reverted esModuleInterop and had to remve lodash.set and its types.

I just published it as v8.4.0

Thank you for the fix! Can you please publish it to npm as well? 🙏

My bad! sorry about that.. its published now