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
Can't use custom type for Request and Response objects in Express 5 #5227
Comments
Hi, I'm new to open source contribution, how can i solve issue.
|
I'm afraid that you have to extend the FYI Express type definitions are maintained in the DefinitelyTyped project and there are no Express 5 specific definitions (I think that the v4 types should be good enough for most use cases). |
Hi. I am trying to use a custom middleware which injects the users company in either the request or response objects. I don't want to use
declare global
for this, as not all of my requests in the app will use this custom middleware. I tried a couple of things, and everything gives me some sort of typescript errorI also tried all of these interfaces:
Nothing works. All errors are something along the lines of this one:
How to properly extend either the request or response objects?????
The text was updated successfully, but these errors were encountered: