Skip to content

Show layout errors in devtools, not just "Error loading layout" #2125

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

Open
leopoldavezacenioka opened this issue Jul 10, 2022 · 4 comments
Open
Labels
dash-dev-tools related to Dash development tools feature something new P2 considered for next cycle

Comments

@leopoldavezacenioka
Copy link

leopoldavezacenioka commented Jul 10, 2022

When using pd.Series with missing values encode as pandas.NA everything run fine however the web page display an error as html code (see img bellow).

I am not sure if this needs a fix I guess u are still waiting to implement support for pandas.NA but it would be helpful to get a python error on execution (which btw is already the case when invoking plotly.Figure show method).

Code to reproduce the bug

import pandas as pd

from plotly.express import line

from dash import Dash, html, dcc

df = pd.DataFrame([[1], [1, 4]], columns=['x', 'y'])
df['y'] = df.y.astype('UInt32')

fig = line(df, x='x',y='y')
fig = dcc.Graph(
    figure= fig
)
app = Dash(__name__)
app.layout = html.Div(children=fig)
app.run(debug=True)

My env

dash                               2.5.1
dash-core-components               2.0.0
dash-html-components               2.0.0
dash-table                         5.0.0

Capture d’écran 2022-07-10 à 16 17 49

@leopoldavezacenioka leopoldavezacenioka changed the title [BUG] "Error loading layout" - when using pandas custom dtypes (UInt, Float) with dash [BUG] "Error loading layout" - when using pd.NA with dash Jul 10, 2022
@alexcjohnson
Copy link
Collaborator

Thanks @leopoldavezacenioka - the underlying issue is tracked here: plotly/plotly.py#3253

I'm going to leave this issue open though, but rename it because really what we should do is show the actual error, rather than just "Error loading layout", when you have debug enabled.

@alexcjohnson alexcjohnson changed the title [BUG] "Error loading layout" - when using pd.NA with dash Show layout errors in devtools, not just "Error loading layout" Jul 11, 2022
@jvbrink
Copy link

jvbrink commented Oct 12, 2022

[...] what we should do is show the actual error, rather than just "Error loading layout", when you have debug enabled.

As a fairly new Dash user this would be a very helpful change.

I just spent a few hours trying to figure out why my Dash application was giving Error Loading Layout and it turned out a corner case in a tiny method made a bad popup on a single marker, which in turn made the whole app simply give the "Error loading layout" error message, and nothing else. So I had little to go on to try to figure out the error.

@gvwilson gvwilson self-assigned this Jul 24, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog feature something new dash-dev-tools related to Dash development tools labels Aug 13, 2024
@BPowell76
Copy link

It would be nice if this was fixed. I have spent several hours trying to figure out why my dataframe causes this generic error message when used in dash_table.DataTable(), but the example data provided by dash works fine.

@gvwilson gvwilson added P2 considered for next cycle and removed P3 backlog labels Mar 31, 2025
@gvwilson
Copy link
Contributor

thanks @BPowell76 - I'll talk to the team and see if we can get some eyes on this. Realistically, though, it's going to be a few weeks. Thanks - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dash-dev-tools related to Dash development tools feature something new P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

5 participants