puppeteer / puppeteer

JavaScript API for Chrome and Firefox
https://pptr.dev
Apache License 2.0
88.66k stars 9.07k forks source link

[Bug]: Raspberry Pi - Error: Failed to launch the browser process! ... Syntax error: ")" unexpected #7736

Closed just-rich closed 2 years ago

just-rich commented 3 years ago

Bug description

Steps to reproduce the problem:

I'm not a developer, so apologies if this is long- just want to explain as much I can to be understood.

Running this on Raspbian GNU/Linux 10 (buster) - I had a developer make a discord bot that automatically relays messages from a channel onto a social media platform, it also takes a screenshot of the message and uploads it with the post. I can also manually post using the bot and upload an image.

The manual posting works perfectly fine, with image upload too. But it's crashing when trying to do the auto-posting. I've upgraded node.js like the troubleshoot guide said, but still didn't work. Not sure what this error is related to and how to fix.

Any suggestions would be great

Puppeteer version

10.4.0

Node.js version

10.24.0

npm version

8.1.0

What operating system are you seeing the problem on?

Linux

Relevant log output

/home/pi/discordbots/peggy/stocktwits/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
/home/pi/discordbots/peggy/stocktwits/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: 1: /home/pi/discordbots/peggy/stocktwits/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: Syntax error: ")" unexpected

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/pi/discordbots/peggy/stocktwits/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
    at Interface.<anonymous> (/home/pi/discordbots/peggy/stocktwits/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)
    at Interface.emit (node:events:402:35)
    at Interface.close (node:readline:586:8)
    at Socket.onend (node:readline:277:10)
    at Socket.emit (node:events:402:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
EqualMa commented 2 years ago

Run into the same situation on Raspbian GNU/Linux 11 (bullseye) with puppeteer@13.0.0, even after reinstalling all apt dependencies listed here.

But I found a workaround with puppeteer-core:

const puppeteer = require("puppeteer-core");
const browser = await puppeteer.launch({ executablePath: "chromium-browser" });
stale[bot] commented 2 years ago

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

stale[bot] commented 2 years ago

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

mattinatux commented 1 year ago

Ran into this one today on a fresh install of Node.JS on a fresh Raspberry Pi (ARM v8), with the same bandaid working.

node -v v20.5.1