denoland/deno · error · AnyError
the following required arguments were not provided: <file_
Error message
the following required arguments were not provided: <file_path>
What it means
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.
Source
Thrown at libs/dcore/src/main.rs:233
let Some(value) = value else {
bail!("equal sign is needed when assigning values to '--v8-flags'");
};
out.v8_flags.extend(value.split(',').map(String::from));
}
_ if name.starts_with('-') && name != "-" => {
bail!("unexpected argument '{name}' found");
}
_ => {
if file_path.is_some() {
bail!("unexpected argument '{arg}' found");
}
file_path = Some(arg);
}
}
}
let Some(file_path) = file_path else {
bail!(
"the following required arguments were not provided:\n <file_path>"
);
};
out.file_path = file_path;
Ok(Some(out))
}
fn inspect(&self) -> Option<(SocketAddr, InspectMode)> {
let default = || "127.0.0.1:9229".parse::<SocketAddr>().unwrap();
if let Some(addr) = self.inspect {
return Some((addr.unwrap_or_else(default), InspectMode::Immediate));
}
if let Some(addr) = self.inspect_wait {
return Some((
addr.unwrap_or_else(default),
InspectMode::WaitForConnection,
));
}View on GitHub (pinned to 9ad36f7a2c)
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.
Example fix
# before dcore --strace-ops # error: the following required arguments were not provided: # <file_path> # after dcore --strace-ops app.js
Defensive patterns
Strategy: validation
Validate before calling
# require a positional file before invoking dcore
has_file=0
for a in "$@"; do case "$a" in -*) ;; *) has_file=1;; esac; done
[ "$has_file" -eq 0 ] && { echo "dcore requires <file_path>"; exit 2; } Prevention
- 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.
When it happens
Trigger: `dcore --strace-ops` with no file; `dcore` invoked bare; `dcore --inspect` with no file; any invocation where all arguments were consumed as options.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- the argument '{previous}' cannot be used with '{name}'
- equal sign is needed when assigning values to '--v8-flags'
- unexpected argument '{name}' found
- unexpected argument '{arg}' found
- Invalid type for fetch: must be a function
AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/6893d9a46acc8014.
Report an issue: GitHub.