Reputation: 91
I'm using Puppeteer 1.20.0 with Chromium-browser v74 on Raspberry pi running Raspbian 10. Using the example code from Puppeteer Github page works as expected when running Puppeteer in headless disabled, however, if I try to run it in headless mode I get this error and it crashes.
UnhandledPromiseRejectionWarning: Error: Navigation failed because browser has disconnected.
My Code:
const puppeteer = require('puppeteer-core');
(async () => {
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
executablePath: '/usr/bin/chromium-browser',
headless: true
});
const page = await browser.newPage();
await page.goto('https://youtube.com');
await page.screenshot({path: 'example.png'});
await browser.close();
})();
The same code works as expected both headless and non-headless in another Debian 10 machine. They both are running Puppeteer 1.20.0 the only difference is the Debian machine is running Google-chrome 77 whereas the Raspbian is running Chromium-browser 74.
I also tried the puppeteer-core version 1.13.0 which is the recommended version for chromium 74 but it also didn't work in headless mode.
Upvotes: 5
Views: 13235
Reputation: 1
Puppeter comes with compatible chromium..in node_modules/puppeter/ look for .local-chromium if you don't find it I suggest delete node_modules and hit "npm i puppeteer"
Upvotes: 0
Reputation: 83
I finally was able to run puppeteer... but not on Raspbian buster. Here are the details of the environment where I successfully ran puppeteer:
chromium-browser
Chromium 72.0.3626.121 Built on Raspbian , running on Raspbian 9.11I did NOT use the downloaded chromium from puppeteer
, I used the one that came with raspbian and added the "executablePath"
config so I can only use "puppeteer-core"
Upvotes: 1
Reputation: 436
Puppeteer is only guaranteed to work with the version of chromium that it is bundled with (puppeteer rather than puppeteer-core). So you would probably have better luck running an older version of puppeteer that is built for chromium 74.
Upvotes: 0