expressjs: typescript: Argument of type 'typeof <express.Router>' is not assignable to parameter of type 'RequestHandlerParams'

Found it, import * as ... seems to lose its typescript information (IRouter, Router)

Solution is to use import loginRouter from './routes/login.router'; instead


I fixed this issue by removing

export default router;

at the end of my router module. I simply exported it where I created it

export const router = express.Router();

and then updated any imports of the module accordingly.

I don't know why the compiler had trouble with the default export, but I know that TypeScript's default exports are not identical to ECMAScript's default exports.