async function f() {
return true;
}
async function return true? No, the function itself always returns a Promise (here is Promise<boolean>). Because it is not true, you encounter the problem. Below are some correct ways to do it.
function f() { // no async declare
asyncFunc().then(value => sendResponse(value));
return true;
}
function f() { // no async declare
// pass sendResponse to another function to use.
// you already use this way, so remove the outer function's sync keyword and remove await keyword inside it.
asyncFunc(sendResponse);
return true;
}