title: Typescript no overload matches this call
body: <p>I'm new to TypeScript and I'm currently stuck. I have a nodejs and express app.</p>
  <p>I'm getting the following error: No overload matches this call.</p>
  <pre><code>The last overload gave the following error.
      Argument of type '{ isLoggedIn: (req: Request&lt;ParamsDictionary, any, any, QueryString.ParsedQs, Record&lt;string, any&gt;&gt;, res: Response&lt;any, Record&lt;string, any&gt;&gt;, next: NextFunction) =&gt; Response&lt;...&gt; | undefined; }' is not assignable to parameter of type 'RequestHandlerParams&lt;ParamsDictionary, any, any, ParsedQs, Record&lt;string, any&gt;&gt;'.
        Type '{ isLoggedIn: (req: Request&lt;ParamsDictionary, any, any, ParsedQs, Record&lt;string, any&gt;&gt;, res: Response&lt;any, Record&lt;string, any&gt;&gt;, next: NextFunction) =&gt; Response&lt;...&gt; | undefined; }' is missing the following properties from type '(ErrorRequestHandler&lt;ParamsDictionary, any, any, ParsedQs, Record&lt;string, any&gt;&gt; | RequestHandler&lt;ParamsDictionary, any, any, ParsedQs, Record&lt;...&gt;&gt;)[]': length, pop,
  </code></pre>
  <h2>This is my route file</h2>
  <pre><code>export {}
  
  import express, { Router } from 'express';
  
  import lessons from '@controllers/lessons';
  import isLoggedIn from '@middleware/user';
  
  const lessonRoutes: Router = express.Router();
  
  
  lessonRoutes.route('/')
          .get(isLoggedIn, lessons.lessonForm)
  </code></pre>
  <hr />
  <p>This is my middleware file</p>
  <pre><code>import { Request, Response, NextFunction } from 'express';
  
  const isLoggedIn = (req: Request, res: Response, next: NextFunction) =&gt; {
      if (!req.isAuthenticated()) {
          return res.status(401).json({
              error: &quot;User must sign in&quot;
            })
      }
      next();
  }
  
  export default {
      isLoggedIn
  }
  
      
  </code></pre>