Skip to content

[BUG] Cannot run debug=True when sub classing html or dcc components  #1285

@gioxc88

Description

@gioxc88
python 3.7.7
dash                 1.11.0
dash-core-components 1.9.1
dash-html-components 1.0.3
dash-renderer        01.4.0
dash-table           4.6.2

Whenever I try to subclass a component I cannot use the app in debug mode.
Unfortunately it becomes unusable without debug mode when developing.

This is the full traceback

Traceback (most recent call last):
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\pkgutil.py", line 493, in find_loader
    spec = importlib.util.find_spec(fullname)
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\importlib\util.py", line 114, in find_spec
    raise ValueError('{}.__spec__ is None'.format(name))
ValueError: __main__.__spec__ is None

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "apptest.py", line 108, in <module>
    app.run_server(debug=True)
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\site-packages\dash\dash.py", line 1475, in run_server
    dev_tools_prune_errors,
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\site-packages\dash\dash.py", line 1282, in enable_dev_tools
    for x in list(ComponentRegistry.registry) + ["dash_renderer"]
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\site-packages\dash\dash.py", line 1277, in <listcomp>
    os.path.dirname(package.path)
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\site-packages\dash\dash.py", line 1282, in <genexpr>
    for x in list(ComponentRegistry.registry) + ["dash_renderer"]
  File "C:\Users\gioxc\AppData\Local\Programs\Python\Python37\lib\pkgutil.py", line 499, in find_loader
    raise ImportError(msg.format(fullname, type(ex), ex)) from ex
ImportError: Error while finding loader for '__main__' (<class 'ValueError'>: __main__.__spec__ is None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions