BigTeech
BigTeech

Reputation: 91

When I use typescript, how can I use the cookie-parser of express

I want to use cookie-parser in expressjs, but typescript can't find the type of request.cookie. How can I solve it?

screenshot

Upvotes: 9

Views: 6055

Answers (1)

Vlad Dekhanov
Vlad Dekhanov

Reputation: 1084

Just make sure that you've imported Request type from express package instead of native request declaration type.

import {Request} from 'express';

Upvotes: 8

Related Questions