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]: Puppeteer keeps crashing

See original GitHub issue

Bug description

Steps to reproduce the problem:

  1. Run npm install
  2. Run npm start
  3. Only occurs on my mac book, but not on my other computer

Puppeteer version

17.1.3

Node.js version

16.0.0

npm version

7.10.0

What operating system are you seeing the problem on?

macOS

Relevant log output

/path/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:285
            return Promise.reject(new Error(`Protocol error (${method}): Session closed. Most likely the ${__classPrivateFieldGet(this, _CDPSession_targetType, "f")} has been closed.`));
                                  ^

Error: Protocol error (Target.activateTarget): Session closed. Most likely the page has been closed.
    at CDPSession.send (/path/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:285:35)
    at next (/path/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:34:41)
    at CDPSession.send (/path/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:67:18)
    at Page._Page_screenshotTask (/path/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2634:59)
    at /path/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2006:93

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
OrKoNcommented, Sep 23, 2022

@sahdbashkdbj I am not sure it’s the bug, very likely the binary is for the wrong platform architecture. Waiting for the reporter to provide the details about their macbook and a repro.

0reactions
lutzklaicommented, Dec 8, 2022

I ran into this issue on my AWS lambda. This error would happen sometimes when I tried to take a screenshot. I couldn’t figure out why it worked most of the time but threw this error for certain scenarios.

I was on a node16 lambda & using the @sparticuz/chromium@109.0.0 & puppeteer@19.4 packages.

I ended up downgrading the lambda node version to 14 and things seem to be working so far.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer crashes on browser.close() with: Received signal ...
Same issue. appears to happen only on .close() and the rest of the process runs fine. there are some errors on launch but...
Read more >
Troubleshooting - Puppeteer
The most common cause is a bug in Node.js v14.0.0 which broke extract-zip , the module Puppeteer uses to extract browser downloads into...
Read more >
Puppeteer crashes Chromium while scrolling Whatsapp : r/node
My current program does scroll up but crashes midway. It is a pretty large convo (>40k messages) but I wanted to know if...
Read more >
Puppeteer discord bot keeps crashing when hosted on ...
Ensure that you're using '--no-sandbox' mode when launching Puppeteer. This can be done by passing it as an argument to your .launch() call:...
Read more >
Fix "Aw, Snap!" page crashes and other page loading errors
Close every tab except for the one that's showing the error message. Quit other apps that are running, and pause any app or...
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