You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to import the package however i have a problem when using it. The following package does not have typescript support for the specific function responseTime(fn)
[ts]
Argument of type '(req: Request, res: Response, time: any) => void' is not assignable to parameter of type 'ResponseTimeFunction'.
Types of parameters 'req' and 'request' are incompatible.
Type 'IncomingMessage' is not assignable to type 'Request'.
Property 'get' is missing in type 'IncomingMessage'.
(alias) interface Request
import Request
src/app.ts:101:35 - error TS2345: Argument of type '(req: Request, res: Response, time: any) => void' is not assignable to parameter of type 'ResponseTimeFunction'.
Types of parameters 'req' and 'request' are incompatible.
Type 'IncomingMessage' is not assignable to type 'Request'.
Property 'get' is missing in type 'IncomingMessage'.
[ X ] I tried using the
@types/xxxx
package and had problems.I am able to import the package however i have a problem when using it. The following package does not have typescript support for the specific function responseTime(fn)
expressjs/response-time#13
Currently
app.use(responseTime(function (req, res, time) {
Expected
app.use(responseTime((req: Request, res: Response, time: any) => {
However it shows me an error
The text was updated successfully, but these errors were encountered: