I'm not sure what the exact cause of this issue is, but I tried to remove the console.log from the custom block, and it works fine. I'm new to Node.js and Express, thus I can not get the exact issue.
As follows is my example, I tackled the issue with "express-validator": "^7.2.1",
.custom(async (value) => {
const ticket = await Ticket.findOne({ _id: value })
if (!ticket) {
throw new Error("NOT_EXIST")
}
// console.lg('ticket result', ticket)
return true
})
I know it's late, but I liked to share my experience and archive this solution for newbie learners like me.