question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Page undefined error occurs sometimes

See original GitHub issue

Hello, 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:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
amazing-tomotoshicommented, Jul 25, 2021

this error occurred. (node:21) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!

this is our code.

const browser = await launch({
        // userDataDir: "./Default_3",
        defaultViewport: null,
        headless: true,
        //ignoreDefaultArgs: "--mute-audio",
        args: [
          "--autoplay-policy=no-user-gesture-required",
          '--start-fullscreen',
          '--no-sandbox',
        ],
    });

What can be the reason for this error?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"undefined" randomly appended in 1% of requested urls on ...
Navigate to one of the pages that has the issue with Firebug open and the Net panel active. In the Net panel there...
Read more >
bug: vue, undefined error when leaving tabs and coming ...
Current Behavior. When navigating, occasionally you'll get an error when exiting a page and entering into a new page ...
Read more >
Error on editing: "undefined" - Sitefinity - Bugs & Issues
Hi,. I am getting an intermittent error in the admin. When I got to edit pages I often get a popup that says...
Read more >
Sometime get "Failed to list templates/v1(undefined)" error ...
This could cause an error when loading the "Add to Project" page. The web console can now load templates using much less data,...
Read more >
"Undefined" error while loading templates
Learn everything about "Undefined" error while loading templates in this article from Elementor's Knowledge Base. Get Elementor tips & more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found