Tell us about your environment:
What steps will reproduce the problem?
Use this code:
const puppeteer = require('puppeteer');
puppeteer.launch({args: ['--no-sandbox']}).then(async browser => {
const page = await browser.newPage();
page.on('frameattached', async frame => {
console.log('Frame found: ' + frame);
console.log('What kind of object is this? ... ' + frame.constructor.name);
const result = await frame.title();
console.log('Result: ' + result);
});
await page.goto('https://www.google.com/chrome/browser/canary.html');
await browser.close();
});
What is the expected result?
That it should no throw an exception.
What happens instead?
I get the following error for every frame:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 9): TypeError: Cannot read property 'evaluate' of null
I get the same problem with other methods that use promises on the Frame object. Non promise-based methods seem to work.
Same occurred to me in the following conditions
Meanwhile, I confirm that it does not occur on the master branch.
It doesn't show the result, though (I didn't look into it yet)
Frame found: [object Object]
What kind of object is this? ... Frame
Frame found: [object Object]
What kind of object is this? ... Frame
Result:
Result:
Frame found: [object Object]
What kind of object is this? ... Frame
Frame found: [object Object]
What kind of object is this? ... Frame
Result:
Result:
@pyper
What happens if you try installing puppeteer@next
instead?
@yujiosaka I think that master branch run you did is working correctly, the frames just didn鈥檛 have titles yet. That is, when frame attached fired the HTML in the page wasn鈥檛 loaded yet, so title was blank. I will test with @next as suggested and report back. Thanks buddy!
@yujiosaka Just tested with the master branch. The issue is corrected there for me too. It appears to be a bug that affects 0.13.0
Thanks for the help!
Most helpful comment
@yujiosaka Just tested with the master branch. The issue is corrected there for me too. It appears to be a bug that affects 0.13.0
Thanks for the help!