Error: Navigating frame was detached
See original GitHub issueSteps to reproduce
Environment:
Puppeteer 2.0.0; OS Windows 10; Node.js 12.0.0;
`const puppeteer = require(‘puppeteer’);
(async () => { const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
page.on('framenavigated', (frame) => {
console.log('Frame navigated: ' + frame.name());
});
page.on('framedetached', (frame) => {
console.log('Frame detached: ' + frame.name());
});
await page.goto('http://example.com');
await page.evaluate(() => {
let iframe;
iframe = document.createElement('iframe');
iframe.name = 'my_frame';
document.body.appendChild(iframe);
});
let frames = await page.frames();
let my_frame = frames[1];
try {
await my_frame.goto('http://example.org');
} catch (error) {
console.log(error);
}
try {
await my_frame.goto('http://example.net');
} catch (error) {
console.log(error);
}
await browser.close();
})();`
What is the expected result? Navigation should be completed without errors.
What happens instead? Error: Navigating frame was detached
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to avoid 'frame got detached' error async validation or ...
The error that is thrown in the second scenario states waitForFunction failed: frame got detached . Which makes sense since the frame no ......
Read more >How to handle detached iframes
Since detached iframes never navigate, we can simply use |window| itself instead of window->frame()->domWindow().
Read more >Frame class - puppeteer library - Dart API
Page.onFrameNavigated - fired when the frame commits navigation to a different URL. Page.onFrameDetached - fired when the frame gets detached from the page....
Read more >fix(navigation): waitForNavigation to pick up aborted ... - Gitnet
// When frame was detached during load, "cancelled" comes before detach. // Ignore it and hope for the best ...
Read more >Working with IFrames and frames
However, if there are no buttons outside of the iframe, you might instead get a no such element error. This happens because Selenium...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cssberries @dmnrmr could you try disabling the
site-per-process
flag?I was struggling with similar problem (frame detaching) on version
2.0.0
. For whatever reason iframe I was interested for was detaching, andpage.frames()
returned an empty array and at the same time iframe was still there in the dom. So downgrading to1.19.0
fixed the problem.