Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcc.Graph rendering goes into infinite error loop when None is returned for Figure #2992

Open
reggied opened this issue Sep 9, 2024 · 0 comments
Labels
bug something broken P3 not needed for current cycle

Comments

@reggied
Copy link

reggied commented Sep 9, 2024

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  dash                           2.18.0
  dash-core-components           2.0.0
  dash-html-components           2.0.0
  dash-table                     5.0.0
  • if frontend related, tell us your Browser, Version and OS

    • OS: MacOS/Linux/Windows
    • Browser Chrome
    • Version 128

Describe the bug

When running the below script (which has a bug: graph_selections returns None instead of a Figure) with python3, and displaying in the Chrome browser, the browser tab seems to lock up. If the developer tools are open, one can see the error count rapidly rising with the errors in the screenshot below being repeated over and over again in a tight loop.

from dash import Dash, html, dcc, callback, Output, Input

app = Dash()
app.layout = html.Div([
    html.Button('RUN', id='run-btn', n_clicks=0),
    dcc.Graph(id='graph-container')
])

@callback(
    Output('graph-container', 'figure'),
    Input('run-btn', 'n_clicks'),
)
def graph_selections(n_clicks):
    print(n_clicks)

if __name__ == "__main__":
    app.run(port=8050, host='0.0.0.0', debug=True)

Expected behavior

An error message in the browser, describing the bad return from the callback..

Screenshots

Screenshot 2024-09-09 at 12 28 28
@gvwilson gvwilson changed the title [BUG]dcc.Graph rendering goes into infinite error loop when None is returned for Figure dcc.Graph rendering goes into infinite error loop when None is returned for Figure Sep 11, 2024
@gvwilson gvwilson added bug something broken P3 not needed for current cycle labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

2 participants