Cannot use html subclass (e.g.: html.Div) with debug mode on

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 ".../", line 26, in main
    app.run_server(host='', debug=True)
  File ".../pypi__dash_2_5_1/dash/", line 2323, in run_server*args, **kwargs)
  File ".../pypi__dash_2_5_1/dash/", line 2107, in run
  File ".../pypi__dash_2_5_1/dash/", line 1864, in enable_dev_tools
    for package in packages
  File ".../pypi__dash_2_5_1/dash/", line 1864, in <listcomp>
    for package in packages
TypeError: '_NamespacePath' object is not subscriptable

Looking at , 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/", line 2548, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/", line 2528, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/flask/", line 1812, in full_dispatch_request
  File "/Users/ziliz/projects/dash-issue/lib/python3.8/site-packages/dash/", 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.