Skip to content

Error codes in JSON output

Every error and warning in the JSON response carries a code. The full list with descriptions is on the Error codes page. Below are the codes most commonly seen in JSON output.

Where errors appear

  • result.error — fatal failure before the command got to actual work (invalid cwd, project root missing, conflicting options).
  • extensions[].errors[] / extensions[].warnings[] — per-extension errors and warnings.
  • notFound[] — names/patterns that didn't resolve to an extension. Not fatal on its own.

Environment (CF5xxx)

CodeWhen it happens
CF.OUTSIDE_PROJECT_ROOTcwd points outside the project root.
CF.PROJECT_ROOT_NOT_FOUNDCouldn't detect the Bitrix project root from the given cwd.
CF.INVALID_CWDThe directory doesn't exist.

These end up in result.error.

Configuration / usage (CF2xxx)

CodeWhen it happens
CF.NOT_FOUNDExtension didn't match any name/pattern. Lands in notFound[].
CF.PACKAGE_PROTECTEDExtension is marked protected and skipped.
CF.OPTION_DENIEDIncompatible options (e.g. --watch with --reporter json). In result.error.

Build (CF1xxx)

Common codes in extensions[].warnings and extensions[].errors for chef build:

CodeMeaning
CF.CIRCULAR_DEPENDENCYCircular dependency between source files.
CF.UNRESOLVED_IMPORTImport couldn't be resolved.
CF.MISSING_EXPORTAn import targets a non-existent export.
CF.UNUSED_EXTERNAL_IMPORTExternal import with no actual usage.
CF.SYNTAX_ERRORSyntax error.
CF.MINIFICATION_ERRORMinifier failed.
CF.BASELINE_JS_UNSUPPORTEDJS feature unsupported by configured targets.
CF.BASELINE_CSS_UNSUPPORTEDCSS feature unsupported by configured targets.
CF.UNEXPECTED_BUILD_ERRORUnexpected Rollup or plugin failure.

Lint (CF4xxx)

CodeMeaning
CF.LINT_FAILEDLinter found errors. Messages — in extensions[].errors[].

The code of a linter message is the ESLint rule id (no-console, import/no-default-export etc.). CF.LINT_FAILED is a fallback when no rule id is available.

Tests (CF3xxx)

CodeMeaning
CF.TEST_FAILEDAt least one test failed.
CF.PLAYWRIGHT_ERRORPlaywright launch error (e.g. browsers missing).
CF.UNKNOWN_BROWSERUnknown browser was requested.
CF.PLAYWRIGHT_CONFIG_NOT_FOUNDplaywright.config not found.

In chef test extensions[].errors[] each entry is one failed test in one browser.

Type-check

CodeMeaning
CF.TS_TYPE_ERRORType-check found errors. errors[] carries frames.

In an errors[] entry code may be a TypeScript code (TS2322, TS2304 etc.) — straight from the compiler.

Internal (CF9xxx)

CodeWhen it happens
CF.PACKAGE_READ_ERRORCouldn't read the extension or its config.
CF.UNCAUGHT_EXCEPTIONUnexpected exception, normalized into the payload.

Example: branching by code in shell

bash
chef build main.core --reporter json | jq -e '
  if .error then
    if .error.code == "CF5002" then "no project root" | halt_error
    elif .error.code == "CF5001" then "bad cwd" | halt_error
    else .error.message | halt_error
    end
  else . end
'

Full list

All chef codes are documented on the main Error codes page.

Released under the MIT License.