Troubleshooting
Find the message from your log below. Set DEBUG to any non-empty value to log the details of failed requests to the BundleWatch service.
Configuration
| Message | What it means and what to do |
|---|---|
[ERROR] Configuration missing | The selected configuration has no files to check. Without globs or --config, BundleWatch searches for bundlewatch.config.* up to and including the nearest package.json directory, then falls back to its bundlewatch key. Add files to that configuration, or select a file with --config. See config discovery. Exits with code 1. |
[FATAL] config.files must be an Array or [FATAL] config.files must only contain objects with a path, e.g. { path: "./dist/*.js" } | files has the wrong shape; see files. Exits with code 1. |
[FATAL] config.compression must be a valid type | defaultCompression or --compression isn't gzip, brotli or none, or --compression has no value. Exits with code 1. |
[FATAL] config.ci.trackBranches must be an Array | Write it as a list, such as ["main"]. Exits with code 1. |
[FATAL] config.normalizeFilenames (…) is not a valid RegExp. | The string isn't a valid regular expression, or --normalize has no value. In JSON, double each backslash. Exits with code 1. |
[FATAL] Could not find JSON config file: …, [FATAL] Could not parse JSON config file: …, [FATAL] Exception while loading JS config: … or [FATAL] Could not parse …/package.json | The file couldn't be read or loaded. Just above, the log shows the error and one of [ERROR] Exception while parsing package.json, [ERROR] Exception while loading JS config, [ERROR] Exception while trying to read JSON config file or [ERROR] Exception while parsing JSON config. --config paths are relative to the current directory. Exits with code 1. |
[FATAL] --config needs the path of a config file | --config has no value, or the next argument starts with -. Exits with code 1. |
[ERROR] unknown option '…' | Check the spelling against Options. Exits with code 1. |
[WARNING] CLI files supplied, config in package.json will be ignored and the other … will be ignored warnings | More than one configuration source is present; see Where configuration comes from. The run continues with the first source. |
Files
| Message | What it means and what to do |
|---|---|
[ERROR] There is no matching file for ./dist/*.js | The path matched no files, which fails the run. Check that the build ran first, and that paths are relative to the directory you run BundleWatch in. |
[ERROR] Could not read file <path> | The glob matched a directory, or a file BundleWatch can't read. This fails the run. Match files only, such as ./dist/**/*.js instead of ./dist/*. |
[INFO] Some files could not be measured, no results saved | Because of the file errors above, this build doesn't save a baseline, and the run fails. Fix those errors. |
PASS <path>: <path>: File removed (… smaller than <base branch>) (gzip) | The file is in the baseline but not in this build. It doesn't fail the check, and it disappears once a tracked-branch build saves a baseline without it. If you didn't remove the file, check that your globs still spell its path the same way and that normalizeFilenames still gives it the same name: see How files are matched. |
< Infinity, as in PASS ./dist/app.js: 30.71KB < Infinity (gzip) | The file has no maxSize, so it can't fail; see files. |
Baselines and comparisons
| Message | What it means and what to do |
|---|---|
[WARNING] Some CI configuration options were not found (…) | BundleWatch is missing the listed values, so it only checks maxSize. This is expected when you run it on your machine. In CI, set the token or the variables it lists. |
[WARNING] bundlewatchServiceHost was not supplied, bundlewatch comparisons unavailable | Expected with bundlewatchServiceHost: null. The run continues without a comparison. |
[WARNING] The ci.repoBranchBase was not supplied, bundlewatch comparisons unavailable | Your configuration sets ci.repoBranchBase to an empty value, such as '' or null, which replaces the detected base branch and CI_BRANCH_BASE. Remove it, or set it to a branch name. The run continues without a comparison. |
[WARNING] The ci.repoCurrentBranch was not supplied, bundlewatch results will not be saved | BundleWatch doesn't know which branch is being built, so the run compares with the baseline but doesn't save one. Set CI_BRANCH, and remove any empty ci.repoCurrentBranch value from your configuration: it replaces CI_BRANCH. |
[ERROR] Unable to fetch fileDetails for baseBranch=… code=404 | The run continues without a comparison. No baseline has been saved for the base branch yet, for example on the first run. It goes away once a build of the base branch has saved one. If it doesn't, check that the base branch is right (see Base and tracked branches) and that it is a tracked branch. |
The same message with code=401 | The service refused the token for this repository, or the commit SHA is missing. On GitHub Enterprise, see GitHub Enterprise. The run continues without a comparison. |
The same message with code=503 | The service couldn't reach GitHub to check the token. The run continues without a comparison; rerun the job. |
The same message with code=ECONNABORTED | The service didn't answer within 10 seconds. Connection errors, such as ENOTFOUND or ECONNREFUSED, mean BundleWatch couldn't connect to it, for example behind a proxy (see Behind a proxy). The run continues without a comparison. |
code=ERR_INVALID_URL in any Unable to … message | bundlewatchServiceHost isn't a full URL, for example because it has no https://. See bundlewatchServiceHost. The run continues without the service. |
[INFO] <branch> is not a branch to track, no results saved | Expected on branches that aren't tracked: the run continues without saving a baseline. To save a branch's results, add it to ci.trackBranches. |
[INFO] Pull request build, no results saved | Expected: the run continues without saving a baseline. See Pull request builds. |
[ERROR] Unable to save fileDetails for currentBranch=… code=… | The baseline wasn't saved, and the run continues. 401: the service refused the token; on GitHub Actions, use the workflow's GITHUB_TOKEN, and elsewhere, use a token of a user with push access (see Service changes). 413: the baseline is larger than 350 KB as JSON; 503 and network codes: as above. |
[WARNING] Unable to create a short results link code=… | The service failed, or didn't answer within 5 seconds, so the run continues and prints the long results link instead. If the service refuses the request, as a service older than 1.0 does, you get the long link without this warning. |
GitHub statuses
| Message | What it means and what to do |
|---|---|
[ERROR] GitHubService HTTP_403 :: … on pull requests from forks | Their token can't post statuses. The run continues; see Pull requests from forks. |
Any other [ERROR] GitHubService HTTP_<code> :: <message> | GitHub refused the status, and the message is GitHub's. The run continues. On GitHub Actions, check that the workflow grants statuses: write. |
[WARNING] Max reported statuses reached, github status will not be reported | More than four files failed. The run continues; see GitHub statuses. |
[FATAL] Uncaught exception, after Error: ECONNABORTED, ENOTFOUND, ECONNREFUSED or a similar code | BundleWatch couldn't post a GitHub status: either GitHub didn't answer within 5 seconds (ECONNABORTED), or the connection failed. BundleWatch posts statuses whenever the token, the repository and the commit are known, so the run fails with exit code 1. For proxies, see Behind a proxy. |
Behind a proxy
BundleWatch doesn't read proxy variables such as HTTPS_PROXY. Behind a proxy, allow direct connections to api.github.com (or your GITHUB_API_URL) and to the BundleWatch service, or unset the token to run only the size check.
Creating a token
| Message | What it means and what to do |
|---|---|
That authorization expired | No token was created: the authorization took more than 10 minutes, or started in another browser. Start again at /setup-github, and finish in the same browser within 10 minutes, with cookies enabled. |
GitHub didn’t issue a token | GitHub didn't exchange the authorization for a token. The page shows GitHub's reason. Start again at /setup-github. |