"stack": "Error: Illegal arguments: undefined, number\n at _asyn

am receiving below error when i try to save document which is modified through instance method. can anyone please provide solution to this.]

await user.save({ validateBeforeSave: false });
error:
“Error: Illegal arguments: undefined, number\n at _async (C:\Users\rajesh\Downloads\node-proj\node_modules\bcryptjs\dist\bcrypt.js:214:46)\n at C:\Users\rajesh\Downloads\node-proj\node_modules\bcryptjs\dist\bcrypt.js:223:17\n at new Promise ()\n at Object.bcrypt.hash (C:\Users\rajesh\Downloads\node-proj\node_modules\bcryptjs\dist\bcrypt.js:222:20)\n at model. (C:\Users\rajesh\Downloads\node-proj\modal\userModal.js:64:32)\n at callMiddlewareFunction (C:\Users\rajesh\Downloads\node-proj\node_modules\kareem\index.js:530:27)\n at model.next (C:\Users\rajesh\Downloads\node-proj\node_modules\kareem\index.js:79:7)\n at _next (C:\Users\rajesh\Downloads\node-proj\node_modules\kareem\index.js:132:10)\n at C:\Users\rajesh\Downloads\node-proj\node_modules\kareem\index.js:555:30\n at processTicksAndRejections (internal/process/task_queues.js:75:11)”
}

Hi @Rajeshkumar_G welcome to the community!

I don’t think we have enough information to determine what’s going on here. The error message is helpful, but the code & circumstances that generates this error must be known as well.

Could you post:

  1. A small, self-contained code that can reliably generate this error message
  2. validateBeforeSave sounds like a mongoose method to me. What’s the mongoose, node, and MongoDB version are you using?

Best regards
Kevin