1

I'm trying to get Google Lighthouse CLI work on my Debian server. I use the following instruction to run headless Chrome: https://github.com/GoogleChrome/lighthouse/blob/master/docs/headless-chrome.md#cli-headless

It installs fine, but when I do:

lighthouse --chrome-flags="--headless" https://github.com

I see this:

  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +0ms
  ChromeLauncher Waiting for browser..... +505ms
  ChromeLauncher Waiting for browser....... +501ms
  ChromeLauncher Waiting for browser......... +501ms
  ChromeLauncher Waiting for browser........... +501ms

I also tried this way: https://github.com/GoogleChrome/lighthouse/blob/master/docs/headless-chrome.md#cli-xvfb

But it results in the following:

# xvfb-run --server-args='-screen 0, 1024x768x16' chromium --user-data-dir=$TMP_PROFILE_DIR --start-maximized --no-first-run --remote-debugging-port=9222 "about:blank"
Xlib:  extension "RANDR" missing on display ":99".
Xlib:  extension "RANDR" missing on display ":99".
[26743:26743:0310/130123.016589:ERROR:desktop_window_tree_host_x11.cc(1141)] Not implemented reached in virtual void views::DesktopWindowTreeHostX11::InitModalType(ui::ModalType)
^C[26743:26743:0310/130133.984678:ERROR:chrome_browser_main_extra_parts_x11.cc(62)] X IO error received (X server probably went away)

Is there anything I'm missing on the software side, or Lighthouse cannot be run on Debian server at all?

Grin
  • 557
  • 1
  • 6
  • 19
  • Have you already tried using `--chrome-flags="--no-sandbox --headless"`? Your system might not be setup to run with the security sandbox. Learn more about the [tradeoffs of the sandbox](https://github.com/GoogleChrome/lighthouse-ci/tree/39d45ea7a369c88adb11c63f27e78ac3330cde9b/docs/recipes/docker-client#--no-sandbox-issues-explained) – Patrick Apr 04 '20 at 22:49
  • Yeah, I did that too, didn't help. – Grin Apr 07 '20 at 10:21

1 Answers1

2

Anyway, I ended up using PageSpeed Insights API instead: https://developers.google.com/speed/docs/insights/v5/get-started

It produces the same JSON that Lighthouse CLI does, but you don't need to setup Chrome or anything, it's just a HTTP request.

Grin
  • 557
  • 1
  • 6
  • 19