I am trying to evaluate a function with puppeteer but the callback is never firing (i am certain the host page is working as expected).
On the host page a listener works like:
DB.when('ready').execute(function(db){
// DB can execute stuff
})
My puppeteer code attempts to fetch the db that is ready:
try {
const dbhandle = await page.evaluate('DB.when("ready")');
const result = await page.evaluate(db => db.execute, function(images) {
console.log(JSON.stringify(images));
//do stuff with callback
}, dbhandle);
console.log('result', JSON.stringify(result));
} catch (e) {
console.log('evaluate', e);
} finally {
console.log('finally');
}
Am having no luck on this.