jdx/mise · error
does not contain the ` ` marker required by --inject, add
Error message
{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:
{TASK_PLACEHOLDER_START}
{TASK_PLACEHOLDER_END} What it means
`mise generate task-docs --inject` requires the target doc to contain explicit TASK_PLACEHOLDER_START/END markers between which generated docs are inserted. When the start marker is missing, mise errors instead of guessing (historically it truncated files without markers and panicked on short files — discussion #4676).
Solutions
- Add the marker block to the doc file: <!-- start marker --> <!-- end marker --> at the location where generated docs should appear
- Verify you pointed --output at the correct file that contains the markers
- Re-generate the doc scaffold if markers were deleted
Example fix
// before (README.md) # Tasks // after (README.md) # Tasks <!-- mise tasks:start --> <!-- mise tasks:end -->
Defensive patterns
Strategy: validation
Validate before calling
grep -q 'mise tasks:start' README.md || echo 'marker missing'
Prevention
- Scaffold docs with the marker block included
- Never delete marker comments during doc edits
- Guard the inject step in CI to fail early with a clear message
When it happens
Trigger: inject_task_docs() does not find TASK_PLACEHOLDER_START in the output file's contents; also fires if only the end marker exists or it precedes the start marker.
Common situations: Freshly created README/docs file where markers were never added; markers accidentally deleted during editing; wrong --output file passed.
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
- contains ` ` but no ` ` after it, --inject requires both…
- --localized-dir cannot be carried to Windows: is not…
- a branch name is required
- a glob is required
- a repository preview directory requires a dry run
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/24e3de9a6575ae59.
Report an issue: GitHub.
Appendix: 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 533346cc37)