Skip to content

Commit

Permalink
docs: add debugging section
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jun 4, 2024
1 parent 1f3f28c commit 3d471bf
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
41 changes: 41 additions & 0 deletions docs/content/1.guide/guides/1.debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Debugging
description: Steps to take when you need to debug Unlighthouse.
---


Unlighthouse is built with many edge-cases in mind, but can't always account for every website.

## Enable debugging logs

If you run into any issues with Unlighthouse, the first step should be to re-run the scan with debugging enabled.

```bash
unlighthouse --site unlighthouse.dev --debug
```

## Watch the browser

When running the scan, you can watch the browser as it runs the Lighthouse tests. This can help you identify any issues that may be causing the scan to fail.

For this to be configured you will need to create a [Configuration file](/guide/guides/config#configuration-file).

```ts [unlighthouse.config.ts]
export default {
puppeteerOptions: {
headless: false,
slowMo: 250, // slow down interactions
},
puppeteerClusterOptions: {
// only run one worker at a time
concurrency: 1,
},
}
```

## Other Steps

- Check out the [Solving Common Issues](/guide/guides/common-issues) guide for common issues and solutions.
- Consider [disabling using the system Chrome](/guide/guides/chrome-dependency) by setting `chrome.useSystem: false`.

If you are still having issues, please reach out on the [Discord](https://discord.gg/275MBUBvgP) for one-on-one help.
24 changes: 22 additions & 2 deletions docs/content/1.guide/guides/chrome-dependency.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ Chrome.

As a fallback, it will download a Chromium binary for you.

## Disabling system chrome
## Disabling system Chrome

You can disable the system chrome usage by providing `chrome.useSystem: false`. This will force the fallback installer to run.
You can disable the system chrome usage by modifying the `chrome.useSystem` flag.

This will make Unlighthouse download and use the latest Chrome binary instead.

```ts
export default {
chrome: {
useSystem: false
}
}
```

## Customizing the fallback installer

Expand All @@ -24,6 +34,16 @@ There are a number of options you can customize on this.
- `chrome.downloadFallbackVersion` - Which version of chromium to use (default `1095492`)
- `chrome.downloadFallbackCacheDir` - Where the binary should be saved (default `$home/.unlighthouse`)

```ts
export default {
chrome: {
useDownloadFallback: true,
downloadFallbackVersion: '1095492',
downloadFallbackCacheDir: '/tmp/unlighthouse'
}
}
```

## Using your own chrome path

You can provide your own chrome path by setting `puppeteerOptions.executablePath`.
Expand Down

0 comments on commit 3d471bf

Please sign in to comment.