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