Remember to use :Promise<any>
import { Request, Response, NextFunction } from 'express';
const isLoggedIn = (req: Request, res: Response, next: NextFunction):Promise<any>=>{ if (!req.isAuthenticated()) { return res.status(401).json({ error: "User must sign in" }) } next(); }
export default { isLoggedIn }
this will solve the typescript problem after new update