Error: .post() requires callback functions but got a [object Undefined] not working

后端 未结 8 1953
执念已碎
执念已碎 2021-02-04 09:35

there are several issues with the same theme, but I could not solve my problem.

Error: Route.post() requires callback functions but got a [object Undefined]
at R         


        
8条回答
  •  暖寄归人
    2021-02-04 10:17

    Always ensure the export name is the same as the import name

    //Function Exported
    exports.isAuthenticatedUser = catchAsyncErrors(async(req, res, next) => {
    }
    
    
    //Function Imported
    const {isAuthenticatedUser} = require('../middlewares/auth');

提交回复
热议问题