Dash error handling behavior

Hi, I’m wondering if this behavior is normal. When I run the following script, the error screen only show up the first time the app is loaded. After I refresh the page, the error screen doesn’t show up and the layout appears like there is no errors.

dash.exceptions.DuplicateIdError

dash.exceptions.DuplicateIdError: Duplicate component id found in the initial layout: input_1

Traceback (most recent call last)

  • File “G:\Python\envs\testing2\Lib\site-packages\flask\app.py”, line 1515, in full_dispatch_request

rv = self.preprocess_request()

  • File “G:\Python\envs\testing2\Lib\site-packages\flask\app.py”, line 1857, in preprocess_request

rv = self.ensure_sync(before_func)()

  • File “G:\Python\envs\testing2\Lib\site-packages\dash\dash.py”, line 1307, in _setup_server

_validate.validate_layout(self.layout, self._layout_value())

  • File “G:\Python\envs\testing2\Lib\site-packages\dash_validate.py”, line 408, in validate_layout

raise exceptions.DuplicateIdError(

dash.exceptions.DuplicateIdError: Duplicate component id found in the initial layout: input_1

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the “Traceback” headline. From the text traceback you can also create a paste of it.

Example script:

from dash import Dash,html
import dash_bootstrap_components as dbc

app = Dash(__name__,
           external_stylesheets=[dbc.themes.CYBORG,
                                 dbc.icons.BOOTSTRAP],)

app.layout = html.Div([
    dbc.Label("Input 1"),
    dbc.Input(id='input_1'),
    dbc.Label("Input 2"),
    dbc.Input(id='input_1'), #duplicated id
])

if __name__ == '__main__':
    app.run(debug=True)

Environment: dash 2.7.0, dash_bootstrap_components 1.2.1

If it is normal, is there a way to change this behavior? I want to catch errors again even after I refresh the page to avoid missing error handling.