TypeError: Router.use() requires middleware function but got a Object
In any one of your js pages you are missing
module.exports = router;
Check and verify all your JS pages
Simple solution if your are using express and doing
const router = express.Router();
make sure to
module.exports = router ;
at the end of your page