{"record":{"id":"885b88194abc013c","repo":"denoland/deno","slug":"the-bench-name-can-t-be-empty","errorCode":null,"errorMessage":"The bench name can't be empty","messagePattern":"The bench name can't be empty","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_bench.js","lineNumber":116,"sourceCode":"      warmupBenchDesc.warmup,\n      registerBenchIdRetBufU8,\n    );\n    warmupBenchDesc.id = registerBenchIdRetBufU8[0];\n    warmupBenchDesc.origin = cachedOrigin;\n  }\n\n  let benchDesc;\n  const defaults = {\n    ignore: false,\n    baseline: false,\n    only: false,\n    sanitizeExit: true,\n    permissions: null,\n  };\n\n  if (typeof nameOrFnOrOptions === \"string\") {\n    if (!nameOrFnOrOptions) {\n      throw new TypeError(\"The bench name can't be empty\");\n    }\n    if (typeof optionsOrFn === \"function\") {\n      benchDesc = { fn: optionsOrFn, name: nameOrFnOrOptions, ...defaults };\n    } else {\n      if (!maybeFn || typeof maybeFn !== \"function\") {\n        throw new TypeError(\"Missing bench function\");\n      }\n      if (optionsOrFn.fn != undefined) {\n        throw new TypeError(\n          \"Unexpected 'fn' field in options, bench function is already provided as the third argument\",\n        );\n      }\n      if (optionsOrFn.name != undefined) {\n        throw new TypeError(\n          \"Unexpected 'name' field in options, bench name is already provided as the first argument\",\n        );\n      }\n      benchDesc = {","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/js/40_bench.js#L98-L134","documentation":"This error is the summary error of `deno fmt --check`: after all files are processed, `finish()` compares an atomic counter of files whose dprint-formatted output differs from their on-disk content. If at least one file is not formatted, deno exits non-zero with this message. It only fires in check mode; a normal `deno fmt` run rewrites the files instead of counting them.","triggerScenarios":"Running `deno fmt --check` (directly or from CI/pre-commit hooks) when any collected file's formatted output differs from disk. The counter is incremented per-file, so a single edited-but-unformatted file triggers it. Files come from the fmt include/exclude config in deno.json plus CLI args.","commonSituations":"CI formatting gate failing because the developer forgot to run `deno fmt` locally; different Deno/dprint plugin versions between machines producing different output; generated code (codegen, snapshots, vendored files) that is never run through the formatter; editors saving with different line endings or adding/removing a trailing newline.","solutions":["Run `deno fmt` at the repo root to rewrite all files, then commit the changes","If a generated/vendored file is flagged, add its directory to `\"fmt\": { \"exclude\": [...] }` in deno.json or pass `--ignore`","Make codegen pipelines pipe their output through `deno fmt` before writing","Pin the same Deno version locally and in CI (e.g. via `deno upgrade --version` or dprint.json pins) so formatting output is identical"],"exampleFix":"# before (CI fails)\ndeno fmt --check\n# Found 3 not formatted files in 42 files\n\n# after\ndeno fmt\ngit commit -am \"format\"\ndeno fmt --check  # passes","handlingStrategy":"validation","validationCode":"# CI: format first, then verify — makes the check deterministic\nDeno 1.x: in a CI step run\ndeno fmt --check || (echo '::error::run `deno fmt` locally' && exit 1)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a pre-commit or pre-push hook that runs `deno fmt`","Run `deno fmt` in the same CI job that runs `--check`, before checking","Exclude generated/vendored directories in deno.json fmt config so they can never fail the gate","Pin one Deno version across the team (e.g. `dprint` plugin versions follow it) to avoid formatting drift"],"tags":["formatting","dprint","ci","fmt-check"],"backgroundTag":"format-check-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}