I have a similar issue with Debug mode breaks when subclassing dash_core_component - #6 by jimhendy but with a different error message:
Traceback (most recent call last):
File ".../main.py", line 26, in main
app.run_server(host='0.0.0.0', debug=True)
File ".../pypi__dash_2_5_1/dash/dash.py", line 2323, in run_server
self.run(*args, **kwargs)
File ".../pypi__dash_2_5_1/dash/dash.py", line 2107, in run
dev_tools_prune_errors,
File ".../pypi__dash_2_5_1/dash/dash.py", line 1864, in enable_dev_tools
for package in packages
File ".../pypi__dash_2_5_1/dash/dash.py", line 1864, in <listcomp>
for package in packages
TypeError: '_NamespacePath' object is not subscriptable
Looking at https://dash.plotly.com/all-in-one-components , it also deliberately set the debug=False. wonder if there’s a Github issue to follow up on that? I use 2.5.1
Sure! I eventually found out that it’s specifically the dev_tools_hot_reload
feature failed that. Once I started starting server with app.run_server(debug=True, dev_tools_hot_reload=False)
, I no longer see the problem.
I been trying to reproduce this in my local machine, but has been unsuccessful. I encountered another error with the following stacktrace:
Traceback (most recent call last):
File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/app.py", line 2548, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app
response = self.handle_exception(e)
File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/app.py", line 1812, in full_dispatch_request
self.ensure_sync(func)()
File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/dash/dash.py", line 2285, in router
raise Exception("`dash.page_container` not found in the layout")
Exception: `dash.page_container` not found in the layout
Please see this branch for more detail. I’ve included the instruction in the README file. GitHub - zxiang77/dash-issue at subclass-div-issue
I also reproduced a similar issue with the same resolution while defining a component under the pages directory in this branch: GitHub - zxiang77/dash-issue
The error message is slightly different from what I saw earlier, I originally saw error like: ‘pages’ package not found. I’ll dig a bit more later. but disabling hot reload also resolve the issue.