[Bug] Page undefined error occurs sometimes
See original GitHub issueHello, thank you for your work!
I’ve been using puppeteer-stream for over a month now and it works perfectly.
However, sometimes it gives the following error at the starting of the code.
(node:20) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘page’ of undefined at /app/node_modules/puppeteer-stream/dist/PuppeteerStream.js:79:63 at Generator.next (<anonymous>) at fulfilled (/app/node_modules/puppeteer-stream/dist/PuppeteerStream.js:5:58) at processTicksAndRejections (internal/process/task_queues.js:95:5)
What can be the reason for this error? And why does it come only once in almost 100 tries? Please let me know how to deal with kind of error?
I believe the error comes because the browser has not started properly.
Thanks again!
PS:
The code where the error comes.
const browser = await launch({ defaultViewport: null, headless: true, args: [ "--autoplay-policy=no-user-gesture-required", '--start-fullscreen', '--no-sandbox', ], }); const page = await browser.newPage(); await page.setViewport({ width: 1400, height: 800}); const navigationPromise = page.waitForNavigation();
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
https://stackoverflow.com/questions/59979188/error-failed-to-launch-the-browser-process-puppeteer
this error occurred.
(node:21) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
this is our code.
What can be the reason for this error?