slint-ui/slint · error

internal compiler error: more than one strong reference left

Error message

internal compiler error: more than one strong reference left to repeated component when lowering shadow properties

What it means

Error "internal compiler error: more than one strong reference left to repeated component when lowering shadow properties" thrown in slint-ui/slint.

Source

Thrown at internal/compiler/object_tree.rs:4578

        .unwrap();
        let expr_v =
            BindingExpression::new_with_span(expr_v, old_root.borrow().to_source_location());
        li_v.element().borrow_mut().set_binding(li_v.name().clone(), expr_v);
        let expr_h =
            BindingExpression::new_with_span(expr_h, old_root.borrow().to_source_location());
        li_h.element().borrow_mut().set_binding(li_h.name().clone(), expr_h);
        Some((li_h.clone(), li_v.clone()))
    });
    new_root.borrow_mut().layout_info_prop = layout_info_prop;
    forward_layout_info_with_constraint(&new_root, old_root);

    // Replace the repeated component's element with our shadow element. That requires a bit of reference counting
    // surgery and relies on nobody having a strong reference left to the component, which we take out of the Rc.
    drop(std::mem::take(&mut repeated_element.borrow_mut().base_type));

    debug_assert_eq!(Rc::strong_count(&component), 1);

    let mut component = Rc::try_unwrap(component).expect("internal compiler error: more than one strong reference left to repeated component when lowering shadow properties");

    let old_root = std::mem::replace(&mut component.root_element, new_root.clone());
    new_root.borrow_mut().children.push(old_root);

    let component = Rc::new(component);
    repeated_element.borrow_mut().base_type = ElementType::Component(component.clone());

    for elem in elements_with_enclosing_component_reference {
        elem.borrow_mut().enclosing_component = Rc::downgrade(&component);
    }
}

/// Make the geometry of the `injected_parent` that of the old_elem. And the old_elem
/// will cover the `injected_parent`
pub fn adjust_geometry_for_injected_parent(injected_parent: &ElementRc, old_elem: &ElementRc) {
    let mut injected_parent_mut = injected_parent.borrow_mut();
    injected_parent_mut.set_binding(
        "z".into(),

View on GitHub (pinned to 3fd8f2ec03)

Solutions

  1. Internal compiler bug: report the .slint file that triggers it.
  2. Try simplifying repeated components with shadow properties.

When it happens

Trigger: Thrown at internal/compiler/object_tree.rs:4578 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slint-ui/slint@3fd8f2ec03 (2026-08-19). Data as JSON: /api/errors/22070541ba477d90. Report an issue: GitHub.