{"record":{"id":"a349b7e81085eba7","repo":"denoland/deno","slug":"an-executable-name-was-not-provided-one-could-not","errorCode":null,"errorMessage":"An executable name was not provided. One could not be inferred from the URL. Aborting.","messagePattern":"An executable name was not provided\\. One could not be inferred from the URL\\. Aborting\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/compile.rs","lineNumber":1313,"sourceCode":"      {\n        out_path = out_path.join(infer_file_name);\n      }\n    } else {\n      out_path = out_path.to_path_buf();\n    }\n    Some(out_path)\n  } else {\n    None\n  };\n\n  if output_flag.is_none() {\n    output_path = bin_name_resolver\n      .infer_name_from_url(&module_specifier)\n      .await\n      .map(PathBuf::from)\n  }\n\n  output_path.ok_or_else(|| anyhow!(\n    \"An executable name was not provided. One could not be inferred from the URL. Aborting.\",\n  )).map(|output_path| {\n    if is_desktop {\n      get_desktop_specific_filepath(output_path, &compile_flags.target)\n    } else {\n      get_os_specific_filepath(output_path, &compile_flags.target)\n    }\n  })\n}\n\nfn get_desktop_specific_filepath(\n  output: PathBuf,\n  target: &Option<String>,\n) -> PathBuf {\n  let is_windows = match target {\n    Some(target) => target.contains(\"windows\"),\n    None => cfg!(windows),\n  };","sourceCodeStart":1295,"sourceCodeEnd":1331,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/compile.rs#L1295-L1331","documentation":"`deno compile` needs a name for the produced binary. If `--output`/`-o` is not given, Deno infers one from the module URL's last path segment. When the URL yields no usable name — it ends in '/', or is a data: URL — inference fails and compilation aborts before doing work.","triggerScenarios":"`deno compile https://example.com/` (no filename in the URL), `deno compile` on a `data:` URL, or any module specifier whose last segment is empty — all without `--output`.","commonSituations":"Compiling web-installed CLIs whose install URL lacks a filename; CI scripts that compile generated or templated URLs without naming the artifact.","solutions":["Pass an explicit name: `deno compile --output=myapp <url>` (short form `-o myapp`)","If the URL was truncated or wrong, fix it so the last segment is a real filename","For install-style flows, prefer `deno install`, which records an explicit command name"],"exampleFix":"# before\ndeno compile https://example.com/\n\n# after\ndeno compile --output myapp https://example.com/","handlingStrategy":"validation","validationCode":"// Wrapper: ensure a name can be inferred, else pass --output explicitly\nconst url = Deno.args.at(-1) ?? \"\";\nlet last = \"\";\ntry {\n  last = new URL(url).pathname.split(\"/\").at(-1) ?? \"\";\n} catch {\n  last = url.split(\"/\").at(-1) ?? \"\";\n}\nconst inferable = last.length > 0 && !url.startsWith(\"data:\");\nif (!inferable && !Deno.args.some((a) => a.startsWith(\"--output\") || a === \"-o\")) {\n  throw new Error(`cannot infer a name from ${url} — pass --output <name>`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --output/-o when compiling from URLs","Prefer deno install for web-installed CLIs, which records the name","Validate templated URLs before compiling them in CI"],"tags":["compile","cli","entrypoint","naming"],"backgroundTag":"output-name-not-inferred","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}