jdx/mise · error

" ". : unknown template engine ' ' (expected "tera")…

Error message

"{path_raw}".{id}: unknown template engine '{other}' (expected "tera"), ignoring entry

What it means

The `template` field of an edit entry opts the content into templating and currently only accepts the value "tera". Any other string causes `resolve_entry` to bail and ignore the entry, since mise cannot render an engine it does not know.

Solutions

  1. Set `template = "tera"` exactly (a string, not a boolean).
  2. Remove the `template` field if templating is not needed.
  3. Re-run the edits command to confirm the entry is applied.

Example fix

# before
[dotfiles."~/.zshrc".greeting]
block = "echo hi {{ env.USER }}"
template = "jinja"

# after
[dotfiles."~/.zshrc".greeting]
block = "echo hi {{ env.USER }}"
template = "tera"
Defensive patterns

Strategy: validation

Validate before calling

if let Some(t) = &e.template {
    if t != "tera" {
        return Err(format!("template must be \"tera\" (or omitted), got {t}"));
    }
}

Type guard

fn is_valid_template(t: &Option<String>) -> bool {
    t.as_deref().map_or(true, |v| v == "tera")
}

Prevention

When it happens

Trigger: An entry sets `template = "jinja"` (or `true`, `handlebars`, etc.). `resolve_entry` matches `Some(other)` in the template match and bails at src/system/edits.rs:333.

Common situations: Users assume other template engines are supported, copy an entry from a different tool, or pass a boolean instead of the string "tera".

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at src/system/edits.rs:333

                }
                (Some(inline), None) => BlockSource::Inline(inline),
                (None, Some(src)) => {
                    let src = file::replace_path(&src);
                    let src = if src.is_relative() {
                        base.join(src)
                    } else {
                        src
                    };
                    origin.source = Some(src.clone());
                    BlockSource::File(src)
                }
                (None, None) => unreachable!("is_block"),
            };
            let template = match entry.template.as_deref() {
                None => false,
                Some("tera") => true,
                Some(other) => {
                    bail!(
                        "\"{path_raw}\".{id}: unknown template engine '{other}' (expected \"tera\"), ignoring entry"
                    )
                }
            };
            let comment = entry
                .comment
                .unwrap_or_else(|| infer_comment(&path).to_string());
            EditOp::Block {
                source,
                template,
                comment,
            }
        }
        (false, Some(line)) => {
            // a "line" is matched against the file's individual lines, so an
            // embedded newline could never converge — use a block for
            // multi-line content
            if line.contains('\n') {

View on GitHub (pinned to 533346cc37)