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.

FreeBSD is not supported

See original GitHub issue

v1.20.0 puppeteer/lib/BrowserFetcher.js: …


class BrowserFetcher {
  /**
   * @param {string} projectRoot
   * @param {!BrowserFetcher.Options=} options
   */
  constructor(projectRoot, options = {}) {
    this._downloadsFolder = options.path || path.join(projectRoot, '.local-chromium');
    this._downloadHost = options.host || DEFAULT_DOWNLOAD_HOST;
    this._platform = options.platform || '';
    if (!this._platform) {
      const platform = os.platform();
      if (platform === 'darwin')
        this._platform = 'mac';
      else if (platform === 'linux')
        this._platform = 'linux';
      else if (platform === 'win32')
        this._platform = os.arch() === 'x64' ? 'win64' : 'win32';
      assert(this._platform, 'Unsupported platform: ' + os.platform());
    }
    assert(supportedPlatforms.includes(this._platform), 'Unsupported platform: ' + this._platform);
  }


freebsd is not supported

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

3reactions
wohalicommented, Nov 9, 2021

With the attached diff (against 10.4.0) I’m able to run puppeteer just fine (in my case, as a Grafana image renderer) on FreeBSD. It’s running headless. Note that this ‘pacifies’ BrowserFetcher.ts because I am not sure how to pass the env var correctly using yarn, which the grafana image renderer uses instead of npm.

@jschfflr is this a PR you would consider accepting? If so I’ll put one up. Cheers!

diff --git a/src/node/BrowserFetcher.ts b/src/node/BrowserFetcher.ts
index d5f25708..0407a5d5 100644
--- a/src/node/BrowserFetcher.ts
+++ b/src/node/BrowserFetcher.ts
@@ -43,6 +43,7 @@ const downloadURLs = {
     mac: '%s/chromium-browser-snapshots/Mac/%d/%s.zip',
     win32: '%s/chromium-browser-snapshots/Win/%d/%s.zip',
     win64: '%s/chromium-browser-snapshots/Win_x64/%d/%s.zip',
+    freebsd: '%s/dummy/%d/%s.zip',
   },
   firefox: {
     linux: '%s/firefox-%s.en-US.%s-x86_64.tar.bz2',
@@ -67,7 +68,7 @@ const browserConfig = {
  * Supported platforms.
  * @public
  */
-export type Platform = 'linux' | 'mac' | 'win32' | 'win64';
+export type Platform = 'linux' | 'mac' | 'win32' | 'win64' | 'freebsd';

 function archiveName(
   product: Product,
@@ -216,6 +217,7 @@ export class BrowserFetcher {
     const platform = os.platform();
     if (platform === 'darwin') this._platform = 'mac';
     else if (platform === 'linux') this._platform = 'linux';
+    else if (platform === 'freebsd') this._platform = 'freebsd';
     else if (platform === 'win32')
       this._platform = os.arch() === 'x64' ? 'win64' : 'win32';
     else assert(this._platform, 'Unsupported platform: ' + platform);
@@ -368,6 +370,8 @@ export class BrowserFetcher {
           archiveName(this._product, this._platform, revision),
           'chrome'
         );
+      else if (this._platform === 'freebsd')
+        executablePath = path.join('usr', 'local', 'bin', 'chrome');
       else if (this._platform === 'win32' || this._platform === 'win64')
         executablePath = path.join(
           folderPath,
diff --git a/src/node/Launcher.ts b/src/node/Launcher.ts
index 402ae0ad..283ad8cc 100644
--- a/src/node/Launcher.ts
+++ b/src/node/Launcher.ts
@@ -122,6 +122,9 @@ class ChromeLauncher implements ProductLauncher {
       // Chromium builds are available.
       if (os.platform() !== 'darwin' && os.arch() === 'arm64') {
         chromeExecutable = '/usr/bin/chromium-browser';
+      // Use ports tree chromium for FreeBSD.
+      } else if (os.platform() === 'freebsd') {
+        chromeExecutable = '/usr/local/bin/chromium';
       } else {
         const { missingText, executablePath } = resolveExecutablePath(this);
         if (missingText) throw new Error(missingText);
2reactions
drookcommented, Nov 16, 2021

As per my observations, chromium merely needs to be in PATH. Plus this:

export PUPPETEER_SKIP_DOWNLOAD=yes 

All the fuss is really about the inability to fetch the binary, which isn’t actually needed and can/should be obtained properly. Yeah, a slight patch for the platform support is still needed though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unsupported FreeBSD Releases
Branch Release Type Release Date EoL stable/4 n/a n/a n/a January 31, 2007 releng/4.11 4.11‑RELEASE Extended January 25, 2005 January 31, 2007 stable/5 n/a n/a n/a...
Read more >
What are the issues with installing FreeBSD 12.2 today?
Hello, We have no regrets with our longtime support of FreeBSD, especially when others refused to do so. However, demand has virtually ceased ......
Read more >
error: 'sysinfo not supported on this platform' in FreeBSD #2629
Problem Hi there, there is some problems when installing and running Rust in FreeBSD. I've already tried that on my son's laptop.
Read more >
mv: rename src to src-no: Operation not supported : r/freebsd
Hello. can someone tell me why I can't rename the src directory ? When I try to do that,it gives the error "operation...
Read more >
FreeBSD mount failed with error: operation not supported by ...
(HOST:Windows GUEST:freeBSD) I run mount command but got an error below. mount -t vboxvfs -w mp /mnt/vbox mount: mp: Operation not supported ......
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