{"record":{"id":"2a04552fc3df4578","repo":"denoland/deno","slug":"no-input-files-specified","errorCode":null,"errorMessage":"No input files specified","messagePattern":"No input files specified","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"cli/tools/transpile.rs","lineNumber":33,"sourceCode":"use deno_graph::GraphKind;\nuse deno_graph::ModuleGraph;\nuse deno_resolver::emit::patch_public_decorator_access_has;\nuse deno_terminal::colors;\nuse sys_traits::PathsInErrorsExt;\n\nuse crate::args::Flags;\nuse crate::args::SourceMapMode;\nuse crate::args::TranspileFlags;\nuse crate::factory::CliFactory;\n\npub async fn transpile(\n  flags: Arc<Flags>,\n  transpile_flags: TranspileFlags,\n) -> Result<(), AnyError> {\n  let files = &transpile_flags.files;\n\n  if files.is_empty() {\n    anyhow::bail!(\"No input files specified\");\n  }\n\n  if files.len() > 1 && transpile_flags.output.is_some() {\n    anyhow::bail!(\n      \"Cannot use --output with multiple input files. Use --outdir instead.\"\n    );\n  }\n\n  if transpile_flags.declaration\n    && transpile_flags.output.is_none()\n    && transpile_flags.output_dir.is_none()\n  {\n    anyhow::bail!(\n      \"Cannot use --declaration without --output or --outdir. Declaration files must be written to disk.\"\n    );\n  }\n\n  let is_stdout_mode = files.len() == 1","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/transpile.rs#L15-L51","documentation":"`deno transpile` requires at least one input file. The tool checks `transpile_flags.files` up front and bails when the vector is empty, because transpiling nothing would otherwise be a silent no-op.","triggerScenarios":"Invoking the transpile subcommand with no positional file arguments, e.g. `deno transpile` or `deno transpile --outdir dist` with no paths following the flags.","commonSituations":"A shell script passes an empty variable or a glob that expands to nothing (`deno transpile $FILES` after a find that matched nothing); CI steps where the previous stage produced no .ts files; expecting stdin support that the subcommand does not have.","solutions":["Pass at least one TypeScript/JSX/TSX file path: `deno transpile src/mod.ts`","If the file list comes from a variable or glob, verify it is non-empty first (e.g. `test -n \"$FILES\"` or `shopt -s failglob` in bash)","Check the invocation shape — input files are positional arguments, not a flag value"],"exampleFix":"# before\ndeno transpile \"$TS_FILES\"\n# after\nif [ -n \"$TS_FILES\" ]; then deno transpile $TS_FILES; else echo \"no input files\" >&2; exit 1; fi","handlingStrategy":"validation","validationCode":"# bash: fail before invoking deno\nfiles=(src/*.ts)\nif [ ${#files[@]} -eq 0 ] || [ ! -e \"${files[0]}\" ]; then echo \"no input files\" >&2; exit 1; fi\ndeno transpile \"${files[@]}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit file list or a checked glob to `deno transpile`","Set `shopt -s failglob` (bash) so empty globs abort the script instead of passing zero args","In CI, assert the previous build stage produced inputs before the transpile step"],"tags":["cli","transpile","usage","validation"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}