{"record":{"id":"6893d9a46acc8014","repo":"denoland/deno","slug":"the-following-required-arguments-were-not-provided","errorCode":null,"errorMessage":"the following required arguments were not provided:\n  <file_path>","messagePattern":"the following required arguments were not provided:\n  <file_path>","errorType":"validation","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"libs/dcore/src/main.rs","lineNumber":233,"sourceCode":"          let Some(value) = value else {\n            bail!(\"equal sign is needed when assigning values to '--v8-flags'\");\n          };\n          out.v8_flags.extend(value.split(',').map(String::from));\n        }\n        _ if name.starts_with('-') && name != \"-\" => {\n          bail!(\"unexpected argument '{name}' found\");\n        }\n        _ => {\n          if file_path.is_some() {\n            bail!(\"unexpected argument '{arg}' found\");\n          }\n          file_path = Some(arg);\n        }\n      }\n    }\n\n    let Some(file_path) = file_path else {\n      bail!(\n        \"the following required arguments were not provided:\\n  <file_path>\"\n      );\n    };\n    out.file_path = file_path;\n    Ok(Some(out))\n  }\n\n  fn inspect(&self) -> Option<(SocketAddr, InspectMode)> {\n    let default = || \"127.0.0.1:9229\".parse::<SocketAddr>().unwrap();\n    if let Some(addr) = self.inspect {\n      return Some((addr.unwrap_or_else(default), InspectMode::Immediate));\n    }\n    if let Some(addr) = self.inspect_wait {\n      return Some((\n        addr.unwrap_or_else(default),\n        InspectMode::WaitForConnection,\n      ));\n    }","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/libs/dcore/src/main.rs#L215-L251","documentation":"After the argument loop, dcore requires at least one positional file_path. If every token was an option (or no arguments were given at all), file_path is None and the parser bails listing the missing required `<file_path>`. `-h`/`--help` is the deliberate exception: it prints usage and exits successfully.","triggerScenarios":"`dcore --strace-ops` with no file; `dcore` invoked bare; `dcore --inspect` with no file; any invocation where all arguments were consumed as options.","commonSituations":"Smoke-testing a flag without providing a script; CI commands assembled from templated variables where the file-path variable expands to empty; copy-paste from examples that omitted the entry file.","solutions":["Add the entry script: `dcore --strace-ops app.js`.","In templates/wrappers, guard so the file argument is never empty before invoking dcore.","Use `dcore -h` when you only want usage — it does not raise this error."],"exampleFix":"# before\ndcore --strace-ops\n# error: the following required arguments were not provided:\n#   <file_path>\n\n# after\ndcore --strace-ops app.js","handlingStrategy":"validation","validationCode":"# require a positional file before invoking dcore\nhas_file=0\nfor a in \"$@\"; do case \"$a\" in -*) ;; *) has_file=1;; esac; done\n[ \"$has_file\" -eq 0 ] && { echo \"dcore requires <file_path>\"; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fail fast in CI templates when the entry-file variable is empty.","Use `dcore -h` for usage checks — it exits cleanly without a file.","Keep a canonical example command with the file argument in runbook docs."],"tags":["cli","arguments","dcore","required-args"],"backgroundTag":"missing-required-argument","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}