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.

Puppeteer executablePath returns non-existant path for firefox when PUPPETEER_PRODUCT = "firefox"

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 5.2.0
  • Platform / OS version: Docker, FROM node:12.18 (stretch)
  • URLs (if applicable):
  • Node.js version: 12.18

What steps will reproduce the problem?

For the dockerfile,

FROM node:12.18

WORKDIR /app

COPY package*.json ./

RUN npm ci

# To get Firefox too. This will not be needed once puppeteer firefox exits beta
RUN cd node_modules/puppeteer && PUPPETEER_PRODUCT=firefox node install.js

COPY . .

For the test,

index.js
const [chromePath, firefoxPath] = (() => {
  const oldEnvVar = "" + process.env.PUPPETEER_PRODUCT;

  process.env.PUPPETEER_PRODUCT = "chrome";
  const CHROME_BIN = puppeteer.executablePath();


  // puppeteer.executablePath() points to an
  // unexistent installation pathpuppeteer.executablePath
  process.env.PUPPETEER_PRODUCT = "firefox";
  const FIREFOX_BIN = puppeteer.executablePath();

  process.env.PUPPETEER_PRODUCT = oldEnvVar;
  return [CHROME_BIN, FIREFOX_BIN];
})();
console.log(firefoxPath);

Please include code that reproduces the issue.

  1. docker build --tag bug . See that the output will be something like
Step 11/12 : RUN cd node_modules/puppeteer && PUPPETEER_PRODUCT=firefox node install.js
 ---> Running in f6ad952bd0bc
Requesting latest Firefox Nightly version from https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central

Firefox Nightly (81.0a1) downloaded to /app/node_modules/puppeteer/.local-firefox/linux-81.0a1
  1. docker run -it bug node . See that the path is
/app/node_modules/puppeteer/.local-firefox/linux-768783/firefox/firefox

What is the expected result? They should be the same

What happens instead?

They are not the same

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
whimboocommented, Jun 24, 2022

No further reply from reporter for more than a year. Closing issue.

0reactions
stale[bot]commented, Jun 24, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't launch firefox · Issue #5376 · puppeteer ... - GitHub
I tried with 2.1.0 but it doesn't work. const browser = await puppeteer.launch({'headless': false, 'product': 'firefox'}) From Puppeteer ...
Read more >
how do you install and run puppeteer for firefox - Stack Overflow
I had a similar issue, the command you have to run is actually the following: PUPPETEER_PRODUCT=firefox npm i puppeteer.
Read more >
mozilla-central: changeset 534188 ...
To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a `Browser` instance: ```js ...
Read more >
Browser Launchers: Puppeteer - Modern Web
Run tests using Puppeteer, using a bundled version of Chromium or Firefox ... launchOptions: { executablePath: '/path/to/executable', headless: false, ...
Read more >
FAQ | Puppeteer
The Puppeteer team needs input from users to stabilize Firefox support and to bring missing APIs to ... by default the Chromium executable...
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