Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] TargetCloseError: Protocol error puppeteer-extra-plugin-stealth #883

Open
Biswajit96 opened this issue Apr 2, 2024 · 2 comments
Open
Labels
issue: bug report A bug has been reported needs triage

Comments

@Biswajit96
Copy link

0|bots | TargetCloseError: Protocol error (Page.addScriptToEvaluateOnNewDocument): Session closed. Most likely the page has been closed.
0|bots | at CdpCDPSession.send (/root/B1/api/node_modules/puppeteer-core/src/cdp/CDPSession.ts:90:9)
0|bots | at next (/root/B1/api/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:34:41)
0|bots | at CdpCDPSession.send (/root/B1/api/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:67:18)
0|bots | at CdpPage.evaluateOnNewDocument (/root/B1/api/node_modules/puppeteer-core/src/cdp/Page.ts:1025:58)
0|bots | at Object.evaluateOnNewDocument (/root/B1/api/node_modules/puppeteer-extra-plugin-stealth/evasions/_utils/withUtils.js:33:17)
0|bots | at Plugin.onPageCreated (/root/B1/api/node_modules/puppeteer-extra-plugin-stealth/evasions/webgl.vendor/index.js:27:27)
0|bots | at Plugin._onTargetCreated (/root/B1/api/node_modules/puppeteer-extra-plugin/src/index.ts:544:22)
0|bots | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@Biswajit96 Biswajit96 added issue: bug report A bug has been reported needs triage labels Apr 2, 2024
@TheMkrage
Copy link

I also have this issue. Any workaround you found @Biswajit96 ?

@Biswajit96
Copy link
Author

no its there but before close page try to remove all task await page.removeAllListeners(); how you will still get errors but it will reduce the number of the error.

page.on('error', err => {
pageLogger.info('crash', err);
page.removeAllListeners();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug report A bug has been reported needs triage
Projects
None yet
Development

No branches or pull requests

2 participants