I am getting typescript errors when using the veri...
# support-questions-legacy
a
I am getting typescript errors when using the verifySession() middleware in express. This line (as found in the documentation when explaining verifySession()):
Copy code
app.post("/test", verifySession(), async (req: SessionRequest, res: express.Response) => {

})
is giving me the following error:
Copy code
No overload matches this call.
  The last overload gave the following error.
    Argument of type '(req: SessionRequest, res: Response<any, Record<string, any>>, next: NextFunction) => Promise<void>' is not assignable to parameter of type 'RequestHandlerParams<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.
      Type '(req: SessionRequest, res: Response<any, Record<string, any>>, next: NextFunction) => Promise<void>' is not assignable to type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.
        Types of parameters 'req' and 'req' are incompatible.
          Type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to type 'SessionRequest'.
            Types of property 'session' are incompatible.
              Type 'Session & Partial<SessionData>' is not assignable to type 'SessionContainerInterface | undefined'.ts(2769)
These are my imports:
Copy code
import express, { Response } from "express";
import {SessionRequest} from "supertokens-node/framework/express";
import { verifySession } from "supertokens-node/recipe/session/framework/express";
r
Hey @adriansteffan
Can you please open an issue about this on our GitHub?
a
Sure thing!
r
thanks
does the function work though (ignoring the TS issue)
a
Yes, it does!
r
I see. Okay. We can have a look next week about the ts issue. Thanks
398 Views