denoland/deno · error · AnyError

equal sign is needed when assigning values to '--v8-flags'

Error message

equal sign is needed when assigning values to '--v8-flags'

What it means

`dcore`'s `--v8-flags` takes its value only in equals form (`--v8-flags=<flags>`), mirroring clap's require_equals behavior. The parser splits each argument on the first `=`; when the flag name appears with no `=`-attached value, it bails with this message instead of consuming the next token.

Source

Thrown at libs/dcore/src/main.rs:216

          seen_inspect_flag = Some(match name {
            "--inspect" => "--inspect",
            "--inspect-brk" => "--inspect-brk",
            _ => "--inspect-wait",
          });
          let addr = parse_addr(name, value)?;
          match name {
            "--inspect" => out.inspect = Some(addr),
            "--inspect-wait" => out.inspect_wait = Some(addr),
            // `--inspect-brk` is accepted but not wired up to the inspector
            // server, matching the previous clap-based behavior.
            _ => {}
          }
        }
        "--strace-ops" => out.strace_ops = true,
        "--strace-ops-summary" => out.strace_ops_summary = true,
        "--v8-flags" => {
          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>"

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Use the equals form: `dcore --v8-flags=--expose-gc app.js`.
  2. Comma-separate multiple flags in one value: `--v8-flags=--expose-gc,--stack-size=984`.
  3. Or set the environment variable instead: `export DCORE_V8_FLAGS=--expose-gc` (CLI flags are appended after it).

Example fix

# before
dcore --v8-flags --expose-gc app.js
# error: equal sign is needed when assigning values to '--v8-flags'

# after
dcore --v8-flags=--expose-gc app.js
dcore --v8-flags=--expose-gc,--max-old-space-size=4096 app.js
Defensive patterns

Strategy: validation

Validate before calling

# catch space-separated --v8-flags before launch
for a in "$@"; do
  [ "$a" = "--v8-flags" ] && { echo "use --v8-flags=<comma-separated flags>"; exit 2; }
done

Prevention

When it happens

Trigger: Running `dcore --v8-flags --expose-gc app.js` or a bare `dcore --v8-flags`; multiple V8 flags are comma-separated in one value: `--v8-flags=--expose-gc,--max-old-space-size=4096`.

Common situations: Habitual space-separated flag syntax from other CLIs; forgetting that this specific flag requires `=`; not knowing `DCORE_V8_FLAGS` env var is the alternative.

Related errors


AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20). Data as JSON: /api/errors/141634718cedc429. Report an issue: GitHub.