{"record":{"id":"6adc0f0dfc0388df","repo":"denoland/deno","slug":"no-bench-modules-found","errorCode":null,"errorMessage":"No bench modules found","messagePattern":"No bench modules found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/bench/mod.rs","lineNumber":491,"sourceCode":"  let specifiers = members_with_bench_options\n    .iter()\n    .map(|(_, bench_options)| {\n      collect_specifiers(\n        CollectSpecifiersOptions {\n          file_patterns: bench_options.files.clone(),\n          vendor_folder: cli_options.vendor_dir_path().map(ToOwned::to_owned),\n          include_ignored_specified: false,\n        },\n        is_supported_bench_path,\n      )\n    })\n    .collect::<Result<Vec<_>, _>>()?\n    .into_iter()\n    .flatten()\n    .collect::<Vec<_>>();\n\n  if !workspace_bench_options.permit_no_files && specifiers.is_empty() {\n    return Err(anyhow!(\"No bench modules found\"));\n  }\n\n  let main_graph_container = factory.main_module_graph_container().await?;\n  main_graph_container\n    .check_specifiers(\n      &specifiers,\n      CheckSpecifiersOptions {\n        ext_overwrite: cli_options.ext_flag().as_ref(),\n        ..Default::default()\n      },\n    )\n    .await?;\n\n  if workspace_bench_options.no_run {\n    return Ok(());\n  }\n\n  let preload_modules = cli_options.preload_modules()?;","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/bench/mod.rs#L473-L509","documentation":"deno bench collected zero bench modules and the permit_no_files option is false (cli/tools/bench/mod.rs:490-492). Discovery per workspace member matches script-extension files whose basename ends with '_bench' or '.bench' or equals 'bench' (has_supported_bench_path_name, cli/tools/bench/mod.rs:451-460), or files matched by explicit bench.include patterns / paths passed on the command line.","triggerScenarios":"Bench files exist but use another naming convention (e.g. benchmarks/bench_insert.ts vs the required *_bench.ts pattern) and no bench.include glob covers them; a fresh repo with no benches yet; all discovered matches excluded by bench.exclude; running deno bench in the wrong directory/workspace member.","commonSituations":"New project where benches haven't been written yet; a CI job that runs deno bench on a template/skeleton repo; teams naming files bench_insert.test.ts out of habit from other frameworks; bench.include misconfigured in deno.json.","solutions":["Name bench files to match the convention: *_bench.ts, *.bench.ts, or bench.ts (any script extension) in/below the workspace","Or pass files explicitly: deno bench src/my_benches/insert.ts (explicit paths are always accepted)","Or add globs in deno.json: \"bench\": { \"include\": [\"src/**/*.bench.ts\"] }","If zero benches is expected (skeleton repo, generated project), pass --permit-no-files so the run succeeds"],"exampleFix":"// before (deno.json)\n{\n  \"bench\": { \"include\": [\"benchmarks/**/*.ts\"] }\n}\n// after - match the file naming actually used, or rename files to *_bench.ts\n{\n  \"bench\": { \"include\": [\"src/**/*.bench.ts\", \"benchmarks/**/*.bench.ts\"] }\n}","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# Verify discovery will find something before invoking deno bench\nshopt -s globstar\nfiles=( **/*_bench.ts **/*.bench.ts **/bench.ts )\n[ ${#files[@]} -gt 0 ] || { echo 'no bench files match *_bench.ts / *.bench.ts / bench.ts'; exit 1; }\ndeno bench \"$@\"","typeGuard":null,"tryCatchPattern":"# Skeleton repos/CI where zero benches is acceptable\ndeno bench --permit-no-files || { rc=$?; [ \"$rc\" -ne 0 ] && echo 'bench discovery empty - add benches or fix bench.include'; exit $rc; }","preventionTips":["Adopt the *_bench.ts / *.bench.ts naming convention from the start","Declare bench.include globs in deno.json when files live outside default discovery","Use --permit-no-files deliberately in generated/template projects"],"tags":["bench","file-discovery","config","cli"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}