jdx/mise · error

{} does not contain the `{TASK_PLACEHOLDER_START}` marker re

Error message

{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:

{TASK_PLACEHOLDER_START}
{TASK_PLACEHOLDER_END}

What it means

With `mise generate task-docs --inject`, inject_task_docs requires the target markdown file to contain the TASK_PLACEHOLDER_START marker (with the end marker later). If the start marker is absent, mise errors instead of guessing — earlier behavior of falling back to 'block starts at byte 0' truncated files that had no markers at all (discussion #4676). Nothing is written when this fires.

Source

Thrown at src/cli/generate/task_docs.rs:145

            let mut out = vec![];
            for task in &visible_tasks {
                out.push(task.render_markdown(&config).await?);
            }
            miseprintln!("{}", out.join("\n\n").trim());
        }
        Ok(())
    }
}

/// Replace everything between the mise-tasks markers in `contents` with `doc`.
///
/// Both markers must be present, with the end marker after the start marker. When
/// a marker is missing this errors instead of writing anything: falling back to
/// "the block starts at byte 0" truncated files that had no markers at all, and
/// panicked outright on files shorter than the marker (discussions/4676).
fn inject_task_docs(contents: &str, doc: &str, output: &Path) -> eyre::Result<String> {
    let Some(start) = contents.find(TASK_PLACEHOLDER_START) else {
        bail!(
            "{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:\n\n{TASK_PLACEHOLDER_START}\n{TASK_PLACEHOLDER_END}",
            file::display_path(output)
        );
    };
    let body_start = start + TASK_PLACEHOLDER_START.len();
    let Some(end) = contents[body_start..]
        .find(TASK_PLACEHOLDER_END)
        .map(|e| e + body_start)
    else {
        bail!(
            "{} contains `{TASK_PLACEHOLDER_START}` but no `{TASK_PLACEHOLDER_END}` after it, --inject requires both markers",
            file::display_path(output)
        );
    };
    let mut contents = contents.to_string();
    contents.replace_range(body_start..end, doc);
    Ok(contents)
}

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Add the placeholder block to the target file: <TASK_PLACEHOLDER_START> <TASK_PLACEHOLDER_END> then rerun with --inject
  2. Copy the marker block from mise's documented task-docs example into your docs file
  3. Run without --inject once to generate the full doc (including markers) and merge manually

Example fix

// before (docs/tasks.md)
# Tasks

// after
# Tasks
<!-- generated tasks; do not edit -->
<!-- TASK_PLACEHOLDER_START -->
<!-- TASK_PLACEHOLDER_END -->
// then: mise generate task-docs --inject
Defensive patterns

Strategy: validation

Validate before calling

# ensure markers exist before injecting
if ! grep -q 'TASK_PLACEHOLDER_START' docs/tasks.md; then
  printf '<!-- TASK_PLACEHOLDER_START -->\n<!-- TASK_PLACEHOLDER_END -->\n' >> docs/tasks.md
fi
mise generate task-docs --inject

Prevention

When it happens

Trigger: Running `mise generate task-docs --inject` against an output file whose contents lack the TASK_PLACEHOLDER_START marker entirely, or a file shorter than the marker string; called from run/inject.

Common situations: Creating a fresh README/docs file by hand and forgetting to add the placeholder block; deleting the markers during a cleanup; pointing --output at a brand-new empty 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


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/24e3de9a6575ae59. Report an issue: GitHub.