gitbutlerapp/gitbutler · error · anyhow::Error

Error when registering schema {} for type {} registered at {

Error message

Error when registering schema {} for type {} registered at {}

The registered dependent type {} has a different signature than what is expected. This indicates a potential name collision. Consider renaming one of the types with either `#[serde(rename = ...)]` or `#[schemars(rename = ...)]`.

What it means

Error "Error when registering schema {} for type {} registered at {} The registered dependent type {} has a different signature than what is expected. This indicates a potential name collision. Consider renaming one of the types with either `#[serde(rename = ...)]` or `#[schemars(rename = ...)]`. " thrown in gitbutlerapp/gitbutler.

Source

Thrown at crates/but-ts/src/main.rs:353

                t.registration_location,
                duplicate.type_name,
                duplicate.registration_location
            );
        } else {
            existing_names.insert(t.name.as_ref(), t);
        }
    }

    for t in &types {
        if let Some(obj) = t.schema.as_object()
            && let Some(serde_json::Value::Object(defs)) =
                obj.get("$defs").or_else(|| obj.get("definitions"))
        {
            for (def_name, def_schema) in defs {
                if let Some(entry) = existing_names.get(&def_name.as_ref()) {
                    let entry_schema = entry.schema.clone().to_value();
                    if !root_equals_def(&entry_schema, def_schema, def_name) {
                        bail!(
                            "Error when registering schema {} for type {} registered at {}\n\nThe registered dependent type {} has a different signature than what is expected. This indicates a potential name collision. Consider renaming one of the types with either `#[serde(rename = ...)]` or `#[schemars(rename = ...)]`.\n",
                            t.name,
                            t.type_name,
                            t.registration_location,
                            def_name
                        )
                    }
                } else {
                    bail!(
                        "Error when registering schema {} for type {} registered at {}\n\nMissing dependent type {}. Consider deriving `JsonSchema` on the type and registering it with `register_sdk_type!()`.\n",
                        t.name,
                        t.type_name,
                        t.registration_location,
                        def_name
                    )
                }
            }
        }

View on GitHub (pinned to caf1f223d3)

When it happens

Trigger: Thrown at crates/but-ts/src/main.rs:353 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/fd4ddac7a933a365. Report an issue: GitHub.