Duplicated Callbacks Output

Hello everyone, I’am having problemes using callbacks :

    def create_callback(app, i):
        @app.callback(
            [Output(f"loco{i}", "children"),
             Output(f"loco{i}", "style")],
            [Input("tabs-example", "value"),
             Input("sous-tabs", "value")],
            [State(f"loco{i}", "id")],
        )
        def render_content(tab, stab, loco_id):
            try:
                locomotive = get_list_locomotives_with_model_DE18()[i - 1]
                resultat = (show_locomotive_health(i), {})
            except IndexError:
                resultat = (None, {'display': 'none'})
            return resultat

    for i in range(1, 201):
        create_callback(app, i)

This callbacks update components with their IDs, but I recieve this issue :
{
“message”: “Duplicate callback outputs”,
“html”: “In the callback for output(s):\n loco200.children\nOutput 0 (loco200.children) is already in use.\nAny given output can only have one callback that sets it.\nTo resolve this situation, try combining these into\none callback function, distinguishing the trigger\nby using dash.callback_context if necessary.”
}
I don’t understand, because each callbacks has a different output, Could anyone help me ?

Welcome to the community @EnzoDa.

Is that only at the app startup? I’m asking because you can’t add callbacks dynamically. You might take a look into pattern matching callbacks, it seems that you could benefit from it.

If you tell us a bit more about your app we might help you if needed.

Also, the error message you get indicates, taht your dash version is quite old. From version 2.9 onwards, duplicated outputs are possible (which in your case will not solve the issue, though) Consider updating.