jdx/mise · error

resource command produced no output

Error message

resource command produced no output

What it means

run_resource_command runs the tool's own executable in isolation (null stdin/stderr, timeout, 4 MiB output cap) and returns its stdout. If the captured output is empty after trimming, mise cannot use it as a resource (e.g. a completion script) and bails with this error.

Solutions

  1. Run the same command manually to see stderr and confirm it prints to stdout
  2. Fix the exec entry to call the correct completion/output subcommand with required flags
  3. Check the tool's requirements (env vars, config) so it produces output non-interactively
  4. Watch for timeouts if the tool hangs; increase config timeout if legitimately slow

Example fix

// before
// exec = ["mytool"]                      # prints nothing
// after
// exec = ["mytool", "completions", "zsh"]  # writes the completion script to stdout
Defensive patterns

Strategy: try-catch

Validate before calling

// run the command manually first; ensure it writes non-empty stdout
const out = execSync('mytool completions zsh', {stdio: ['ignore','pipe','inherit']}).toString();

Try / catch

try { out = await runResourceCommand(...) } catch (e) { if (/produced no output/.test(e.message)) { tryNextResourceSource(); } else { throw e; } }

Prevention

When it happens

Trigger: The invoked command exits without writing anything to stdout — the tool's completions subcommand prints to stderr, the command requires args it did not get, it detects non-TTY and prints nothing, or it times out producing partial/empty output.

Common situations: Wrong subcommand for generating completions, tool needs an env/flag to emit output, tool writes completions to a file instead of stdout, silent failure swallowed because stderr is nulled.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/7f016e8d6c288fad. Report an issue: GitHub.

Appendix: source

Thrown at src/packslip.rs:1394

    path: &Path,
    args: &[String],
    env: &BTreeMap<String, String>,
    install_path: &Path,
    timeout: std::time::Duration,
) -> Result<String> {
    let work = tempfile::tempdir()?;
    let output = CmdLineRunner::new(path)
        .args(args)
        .envs(env)
        .prepend_path(vec![install_path.join(MISE_BINS_DIR)])?
        .current_dir(work.path())
        .stdin(std::process::Stdio::null())
        .stderr(std::process::Stdio::null())
        .with_timeout(timeout)
        .read_isolated(4 * 1024 * 1024)
        .await?;
    if output.trim().is_empty() {
        bail!("resource command produced no output");
    }
    Ok(output)
}

/// Derive a completion script from a CLI spec with the consumer's own
/// tooling. Only the `usage` format is known.
fn derive_from_spec(format: &str, bin: &str, spec: &Path, shell: &str) -> Result<String> {
    if format != "usage" {
        bail!("mise cannot derive completions from a {format} spec");
    }
    // Validate before returning a loader, so an invalid preferred spec still
    // falls through to another resource source.
    file::read_to_string(spec)?
        .parse::<usage::Spec>()
        .map_err(|err| eyre!("invalid usage specification: {err}"))?;
    let shell = usage_rs::complete::Shell::from_name(shell)
        .ok_or_else(|| eyre!("unsupported completion shell: {shell}"))?;
    let path = completions::encode_spec_path(spec);

View on GitHub (pinned to 533346cc37)