Skip to content

"Error Loading Dependencies" another cause #272

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

Closed
ccamenares opened this issue Jun 15, 2018 · 2 comments
Closed

"Error Loading Dependencies" another cause #272

ccamenares opened this issue Jun 15, 2018 · 2 comments

Comments

@ccamenares
Copy link

This issue seems related to issue #125 , but it was asked to open new issues for all ways this could possible by reproduced, thus this new issue. 😄

I have the following code that generates the issue:

 1 import dash
 2 import dash_core_components as dcc                                                                             
 3 import dash_html_components as html                                                                            
 4     
 5 from header import header                                                                                      
 6             
 7 app = dash.Dash()
 8 app.config.suppress_callback_exceptions = True                                                                 
 9                 
10 app = dash.Dash(                                                                                               
11     __name__,
12     static_folder='static'
13 )                   
14                     
15 def what_is_dash():                                                                                            
16     return(     
17         html.Div(   
18             html.H2("Removed the real text", style = {                                                                 
19                 'display': 'inline-block',                                                                     
20                 'color': 'rgb(0,67,147)'
21             })          
22         ),          
23         html.Div([                                                                                             
24             html.P("Removed the real text"),
25             html.P("Removed the real text")
26         ])
27     )
28 
29 app.layout = html.Div([
30     header(),
31     what_is_dash()
32 ])
33 
34 app.css.append_css({
35     'external_url': 'https://codepen.io/chriddyp/pen/bWLwgP.css'
36 })
37 
38 if __name__ == '__main__':
39     app.run_server(debug=True)

The contents of the file header are below:

 1 import dash_html_components as html                                                                            
 2                                                                                                                
 3 def header():                                                                                                  
 4     return(                                                                                                    
 5         html.Div(                                                                                              
 6             style={                                                                                            
 7                 'height': '70px',                                                                              
 8                 'padding': '20px',                                                                             
 9                 'backgroundColor': 'rgb(255, 255, 255)'                                                        
10             },                                                                                                 
11             children=[                                                                                         
12                 html.H1('Removed the real text', style={                                                       
13                     'display': 'inline-block',                                                                 
14                     'color': 'rgb(0, 67, 147)'                                                                 
15                 }),                                                                                            
16                 html.Img(                                                                                      
17                     src='static/logo.png',                                                                     
18                     style={                                                                                    
19                         'float': 'right',                                                                      
20                         'display': 'inline-block',                                                             
21                         'height': '100%'                                                                       
22                     }                                                                                          
23                 ),                                                                                             
24             ]                                                                                                  
25         )                                                                                                      
26     )   

The weird thing is, if I replace what_is_dash() with the code inside of that function's return, the app works fine. It is only when I try to create this function do I get the error. I had tried to make what_is_dash() its own file, like header() but I got the same issue. I tried to rename the function and file to whatIsDash() and make the filename different than the function name; none of that worked.

@ccamenares
Copy link
Author

ccamenares commented Jun 15, 2018

I was able to fix this problem by doing the following:

15 def what_is_dash():                                                                                            
16     return(                                                                                                    
17         html.Div([                                                                                             
18             html.Div(                                                                                          
19                 html.H2("Removed the real text", style = {                                                             
20                     'display': 'inline-block',                                                                 
21                     'color': 'rgb(0,67,147)'                                                                   
22                 })                                                                                             
23             ),                                                                                                 
24             html.P("Removed the real text"),
25             html.P("Removed the real text")                                           
26         ])  
27     )

(Restructured how the divs work.)

I'll leave this issue open incase the original cause is still considered an issue, but am okay with it being closed.

@gvwilson
Copy link
Contributor

gvwilson commented Jun 3, 2024

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants