Dash: An error when a certain number of outputs reached

I have a callback function that has seven outputs and two inputs. With this configuration a page refuses to render past a certain point. If I comment out any of the outputs, however, the page got rendered OK.

        Output('Weight-Matrix', 'data'),
        Output('Scenario-Names', 'data'),
        #Output('fi-dropdown', 'value'),
        Output('mm-dropdown', 'value'),
        Output('equity-dropdown', 'value'),
        Output('balanced-dropdown', 'value'),
        Output('alternative-dropdown', 'value'),
        Input('upload-data', 'contents'),
        Input('manual-weights-btn', 'n_clicks'),
        State('Manual-table', 'data'),
        State('Manual-table', 'columns'),
        State('upload-data', 'filename'),
def set_new_weights_or_import_file(list_of_contents, n_clicks, table_data, Columns, list_of_names):
    Updates and stores the weight matrix based on current table data

    if scenario file is imported - processes the import

    Inputs (changes trigger callbacks):
    - n_clicks: clicks of button with id "manual-weights-btn"
    - list_of_contents: content of an imported file

    States (changes do not trigger callbacks):
    - table_data: current data in the table with id "Manual-table"
    - columns: the column dictionary of the table with id "Manual-table"
    - list_of_names: list of imported file names

    - updated "weight_matrix"
    - updated "names", if the user has changed them
    - values of fi-dropdown
    - values of mm-dropdown
    - values of equity-dropdown
    - values of balanced-dropdown
    - values of alternative-dropdown

    # If button pressed, update the weight matrix and scenario names.
    # If not, do not update.
    if n_clicks:
        n_scen = len(table_data[0]) - 1
        keys = [x['Asset'] for x in table_data]
        vals = [[x[f'scen-{i + 1}'] for i in range(n_scen)] for x in table_data]

        return dict(zip(keys, vals)), [Col['name'][1] for Col in Columns[1:]], dash.no_update, dash.no_update, dash.no_update, dash.no_update, dash.no_update
    elif list_of_contents:
        return parse_scenario_file(list_of_contents, list_of_names)
        return dash.no_update, dash.no_update, dash.no_update, dash.no_update, dash.no_update, dash.no_update, dash.no_update

Hi @mr_with_dash and welcome to the Dash community :slightly_smiling_face:

Do you get an error message? It’s likely that one of your return statements has 6 outputs rather than 7.

There is no error message and the number of return statements matches the number of outputs (7)

@mr_with_dash Could you make a minimal reproducible example? It would help figure out what’s wrong. Dash isn’t limited to less than 7 Outputs in a callback.