-
Notifications
You must be signed in to change notification settings - Fork 444
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
Typescript error when using ExpressJwtRequest #284
Comments
Workaround is to use |
Yes, I was able to reproduce this problem and I can't see an easy way to fix it. I'd like to keep But OTOH, all examples I see extending express request add the properties as optional. If we decide to change that, I will need to release a new major because making it optional will break existing projects using v7. And tbh I don't like the name |
Hey, a related issue in the |
It is my understanding this issue lies entirely in auth0/node-jwks-rsa#299 from them using deprecated types. I've submitted auth0/node-jwks-rsa#301, which fixes my issues. You may want to check if the proposed |
@carboneater thanks for the fix in node-jwks-rsa! Your solution is much better. I recently added an alias to express-jwt for the old signatures because it was reported in another thread: Anyway that should be fixed now in both places 🎉 |
I just deprecated the
|
Description
Using the
ExpressJwtRequest
with Express causes this error to be thrown by the Typescript compiler, when"strict": true
is set:Reproduction
Use the Typescript example found on the main page with
"strict": true
in yourtsconfig.json
:Environment
express-jwt
7.5.2express
4.18.0,@types/express
4.17.13typescript
4.6.3,node
12.22.12jwks-rsa
2.1.0The text was updated successfully, but these errors were encountered: