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.

pupeteer-firefox doesn't launch firefox

See original GitHub issue

Steps to reproduce

  • Puppeteer version: “puppeteer-firefox”: “^0.5.0”,
  • Platform / OS version: macOS Catalina
  • Node.js version: v10.12.0

What steps will reproduce the problem?

run the code from example:

const pptrFirefox = require('puppeteer-firefox');
 
(async () => {
  const browser = await pptrFirefox.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();

example code from https://github.com/puppeteer/puppeteer/tree/master/experimental/puppeteer-firefox

What is the expected result? to launch headless ff and to throw no errors 😃 original puppeteer with chromium works great, but only with sudo

What happens instead?

> sudo node pup
(node:27684) UnhandledPromiseRejectionWarning: Error: Failed to launch Firefox!


    at onClose (/Users/kek/project/node_modules/puppeteer-firefox/lib/Launcher.js:263:14)
    at Interface.helper.addEventListener (/Users/kek/project/node_modules/puppeteer-firefox/lib/Launcher.js:252:50)
    at Interface.emit (events.js:187:15)
    at Interface.close (readline.js:379:8)
    at Socket.onend (readline.js:157:10)
    at Socket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  -- ASYNC --
    at Puppeteer.<anonymous> (/Users/kek/project/node_modules/puppeteer-firefox/lib/helper.js:31:27)
    at /Users/kek/project/pup.js:4:37
    at Object.<anonymous> (/Users/kek/project/pup.js:9:3)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
(node:27684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:27684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
OysterD3commented, Dec 23, 2019

same problem!!! Puppeteer version: “puppeteer-firefox”: “^0.5.0”, Platform / OS version: Linux version 4.4.0-33.bm.1-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10) ) Node.js version: v8.9.1

I found the solution try

sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
0reactions
OysterD3commented, Jun 19, 2020

same problem!!! Puppeteer version: “puppeteer-firefox”: “^0.5.0”, Platform / OS version: Linux version 4.4.0-33.bm.1-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10) ) Node.js version: v8.9.1

I found the solution try

sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

How can I install these package on centos7 3.10.0-693.el7.x86_64? it works on ubuntu but my server is centos

Can’t help you, never try on centos

Read more comments on GitHub >

github_iconTop Results From Across the Web

how do you install and run puppeteer for firefox - Stack Overflow
Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.
Read more >
How to Run Puppeteer with Firefox Instead of Chrome
Puppeteer runs headless by default. You will not see the Firefox browser being launched. If you want to watch Puppeteer running with Firefox,...
Read more >
How to run Tests in Puppeteer with Firefox - BrowserStack
How to run Puppeteer tests in Firefox ; Windows Command Line. set PUPPETEER_PRODUCT=firefox ; Windows Powershell / Visual Studio Code Terminal. $ ...
Read more >
1693011 - Firefox hangs during startup when both headless ...
When running headless Puppeteer tests with Firefox Nightly on Linux for some tests Firefox hangs during startup. As result of these failures tests...
Read more >
[meta] Support running WordPress Gutenberg test suite ...
WordPress is using Puppeteer to run integration tests and for now only run them against ... Add the following line, that refers to...
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