Skip to content

"Error Loading Dependencies" when component is missing #455

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
glennlawyer opened this issue Nov 9, 2018 · 0 comments
Open

"Error Loading Dependencies" when component is missing #455

glennlawyer opened this issue Nov 9, 2018 · 0 comments
Labels
bug something broken P3 backlog

Comments

@glennlawyer
Copy link

As per "Dash: A Pleasant and Productive Development Experience" https://github.com/plotly/dash/issues/125 I have found another cause of the "Error loading dependencies" error message.

The error fires when the component does not exist. Similar to already suspected problem:

@chriddyp

believe that the main cause is component property values that aren't the correct type.

I discovered the example when building a multi-page app. The dcc.Location object fires before the page with the component loads. I'll use the "hidden div" trick instead.

Minimal example. A cut and paste from https://dash.plot.ly/state with input 2 commented out and supress_callback_exceptions set to True.

# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.config['suppress_callback_exceptions']=True 

app.layout = html.Div([
    dcc.Input(id='input-1-state', type='text', value='Montréal'),
    # dcc.Input(id='input-2-state', type='text', value='Canada'),
    html.Button(id='submit-button', n_clicks=0, children='Submit'),
    html.Div(id='output-state')
])


@app.callback(Output('output-state', 'children'),
              [Input('submit-button', 'n_clicks')],
              [State('input-1-state', 'value'),
               State('input-2-state', 'value')])
def update_output(n_clicks, input1, input2):
    return u'''
        The Button has been pressed {} times,
        Input 1 is "{}",
        and Input 2 is "{}"
    '''.format(n_clicks, input1, input2)


if __name__ == '__main__':
    app.run_server(debug=True)
HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 28, 2021
HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 28, 2021
HammadTheOne pushed a commit that referenced this issue Jul 23, 2021
* 🐛 fixes both #455 and #513
@gvwilson gvwilson self-assigned this Jul 17, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog bug something broken labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants