playwright: [BUG] Whole Browser Context shouldn't be closed for error on single page.
Playwright: “^1.14.1”, Browser: Firefox | Chromium | Edge
My whole browser contexts gets killed when single page encouters some error due to weird proxy errors. I don’t think if single page has error whole browser context should be closed.
pw:api => browserType.launch started +0ms
pw:api <= browserType.launch succeeded +984ms
pw:api => browser.newContext started +1ms
pw:api <= browser.newContext succeeded +3ms
pw:api => browserContext.newPage started +1ms
pw:api navigated to "about:blank" +191ms
pw:api navigated to "about:blank" +325ms
pw:api <= browserContext.newPage succeeded +2ms
pw:api => browserContext.newPage started +1ms
pw:api navigated to "about:blank" +137ms
pw:api navigated to "about:blank" +26ms
pw:api <= browserContext.newPage succeeded +1ms
[REQ] 1 of 17576 : https://jsonip.com
pw:api => browserContext.newPage started +1ms
pw:api navigated to "about:blank" +113ms
pw:api navigated to "about:blank" +11ms
pw:api <= browserContext.newPage succeeded +1ms
pw:api => page.goto started +1ms
pw:api navigating to "https://jsonip.com/", waiting until "load" +0ms
pw:api <= page.goto failed +4s
pw:api => browserContext.newPage started +506ms
pw:api <= browserContext.newPage failed +1ms
Whats happening here is I open page the page fails now whole contexts gets removed and i can’t call context.newPage on existing context. If I do it it throws this error:
browserContext.newPage: Target page, context or browser has been closed
at newPage (file:///C:/Users/quantum/Desktop/projects/mike/tm-did/dist/scrapper_utils/browser.js:83:30)
at do_it (file:///C:/Users/quantum/Desktop/projects/mike/tm-did/dist/main.js:48:20) {
name: 'Error'
The code is normal looking context.newPage so I am not posting here.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 16 (4 by maintainers)
@shirshak55 I didn’t find your e-mail; would you mind sending one more time? Also, I’d need the
proxies.jsfile so that I can actually run your snippet locally