Dash with dcc.location (URL) input gives duplicate callback exception after refreshing the app more than twice


I’m trying to create this dash app that takes two types of input in the callback:

  1. Input via input boxes
  2. Input via URL query params
    Either way, whenever I try putting the input, it says the app is updating and then after that it shows only half the expected output.
    However, whenever, I refresh the page again and re-enter the input, it displays the full output.
    Note: After refreshing the page second time (after the input was provided), the second callback is called (via first callback) and then the correct/expected output is provided.
    Ideally, as soon as the input is given, the first callback should be called (which is happening), however, the second callback is not called.

Now, if I refresh the page again, I get duplicate callback exception (in relation to second callback components, in which it says Output already in use).

Any clues why this is happening?
Any help would be appreciated as this is blocking my task.

Following is an example code corresponding with callbacks:

        Output("page-content", "children"),
        [Input("url", "pathname"),
         Input("submit-button", "n_clicks"),
         State("input1", "value"),
         State("input2", "value")],
       def callback_function_1(pathname, n_clicks, val1, val2):
         if pathname or n_clicks:
                result = some_function() # [Note: this calls another function that contains the other callback]
                return html.div(<some value based on result>)

def some_function():
       <make some calls>
        Output(some_table_header, 'children'),
        Input({'type': 'some-dropdown' , 'index': ALL}, 'value'))
    def callback_function_2(values):
            return some_list # [based on the values obtained]

It sounds like you are (accidentally) registrering callback on runtime? Please post a small example demonstrating the issue.

Hi Emil,

I’ve added an example to the issue. Please have a look.