Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels