Router.use() requires a middleware function but got a string at Function.use code example Example: TypeError: Router.use() requires a middleware function but got a Object module.exports = router;