I wrote this code in lib/helper.js
var myfunction = async function(x,y) {
....
return [variableA, variableB]
}
exports.myfunction = myfunct
If you are writing a Chrome Extension and you get this error for your code at root, you can fix it using the following "workaround":
async function run() {
// Your async code here
const beers = await fetch("https://api.punkapi.com/v2/beers");
}
run();
Basically you have to wrap your async code in an async function
and then call the function without awaiting it.