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.

ExecutablePath option ignored

See original GitHub issue

MacOS / BigSur Node 16 (Head) puppeteer-core, 5.5.0

const puppeteer = require('puppeteer-core');
const browser = await puppeteer.launch({
  product: 'chrome',
  headless: false,
  executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
});

Fails with

Error: Failed to launch the browser process! spawn /usr/bin/chromium-browser ENOENT

As I understand it, it should not be trying to launch chromium at all given the above options and use of puppeteer-core.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

4reactions
nccommented, Nov 22, 2020

If however, one modifies the BrowserRunner directly to hardcode the executablePath as shown above, all works as expected. So it seems to be an issue with how the option is being passed to Puppeteer, or how it’s being handled.

class BrowserRunner {
    constructor(executablePath, processArguments, tempDirectory) {
        this.proc = null;
        this.connection = null;
        this._closed = true;
        this._listeners = [];
        this._executablePath = executablePath;
        this._processArguments = processArguments;
        this._tempDirectory = tempDirectory;
    }
    start(options) {
        console.log('>>>>', this._executablePath);
        this._executablePath = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';

This prints >>>> /usr/bin/chromium-browser and then proceeds to launch Google Chrome as expected.

2reactions
eugene1gcommented, Dec 23, 2020

This happens on Apple Silicon. The path is hardcoded at https://github.com/puppeteer/puppeteer/blob/d901696e0d8901bcb23cf676a5e5ac562f821a0d/src/node/Launcher.ts#L106-L109 introduced in https://github.com/puppeteer/puppeteer/commit/354f9424ae4014e0cd276a930d86a6dae8fe427e

Chromium can run natively on Apple Silicon. Puppeteer does not yet link to that binary, but if the developer uses executablePath to point to another Chrome instance (that might not be compatible with Puppeteer), they already take on those risks and the library should just accept that path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Puppeteer executablePath chrome in your local ...
When I did a local development test in windows, happen was problem in executablePath. "Failed to launch chrome! spawn /usr/bin/chromium-browser ...
Read more >
".NET Cli executable path" option is ignored for starting MSBuild.dll ...
NET Cli executable path" option is ignored for starting MSBuild.dll ... So Rider attempts to use /usr/share/dotnet/dotnet and ignores the setting.
Read more >
fix(inspector): fall back to custom executable path for UI (#6214)
fix(inspector): fall back to custom executable path for UI (#6214. An error occurred. ) ... Pass "executablePath" option directly.`);.
Read more >
Executable path is not absolute - linux - Super User
[/lib/systemd/system/sidekiq.service:30] Executable path is not absolute, ignoring: ... Service lacks both ExecStart= and ExecStop= setting.
Read more >
Configuration — SQLFluff 1.4.5 documentation
Additionally, some rules have a special force_enable configuration option, ... Ignoring Jinja templating errors provides a way for users to use SQLFluff ...
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