web-ext lint errors block the build in CI
web-ext lint runs the same addons-linter AMO uses. When it reports one or more errors (not just warnings) it exits non-zero, which fails the CI step before you ever upload.
What this error means
web-ext lint prints a table of messages with a non-zero count under "errors", then exits with a failure code that stops the workflow.
web-ext
Validation Summary:
errors 1
notices 0
warnings 2
JSON_INVALID "/permissions/0" is not a valid permissionCommon causes
An invalid manifest field or permission
The linter flags an unknown permission, a malformed key, or a missing required field as a hard error.
Disallowed or deprecated APIs in code
addons-linter raises errors for patterns AMO will not accept, such as remote code evaluation.
How to fix it
Resolve each reported error
- Read the message code and the JSON pointer or file:line it cites.
- Fix the manifest field or code it names.
- Re-run
web-ext lintuntil only warnings remain.
Terminal
web-ext lint --source-dir dist --warnings-as-errors=falseLint the built output, not the source
Point web-ext at the bundled directory so the manifest and assets it checks are the ones you will ship.
.github/workflows/ci.yml
- run: npm run build
- run: npx web-ext lint --source-dir distHow to prevent it
- Run
web-ext linton the built output in every CI run. - Keep the manifest to documented keys and permissions only.
- Treat lint errors as blocking before signing or uploading.
Related guides
web-ext sign "Your add-on failed validation" in CIFix web-ext sign "Your add-on failed validation" in CI - AMO ran the signing validator on your uploaded XPI a…
Manifest V3 "browser_action is deprecated, use action" in CIFix Manifest V3 "browser_action is deprecated, use action instead" in CI - V3 merges browser_action and page_…
web-ext build "Artifact already exists" / overwrite in CIFix web-ext build "Artifact ... already exists" in CI - a previous artifact of the same name is present and w…