Try another structure using —> .then(()={ });
exportasyncfunction UpdateTasks (ToUpdate) {
let options = { "suppressAuth": true, "suppressHooks": true};
let success = false
return wixData.query("Tasks")
.eq("title",ToUpdate.record)
.find()
.then(()=>{
//...continue here your code.....
});
return //.....here the end-return
}