✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

[SOLVED] Intermittent Dash Dependency Exception: "dash_daq" is registered but the path requested is not valid

I’m coming across an intermittent exception that I can’t quite figure out. I only see the exception when running the app through a WSGI like Waitress or Gunicorn. I do not see this error when running the app directly in developer mode.

I occasionally get the following exception error when loading the page. It’s not consistent, but it appears to prevent components from fully loading. I’ll see several charts with only a loading animation. If I refresh the page, the components usually update fine. Again, this is intermittent, so not exactly sure where the breakdown is.

Exception on /dashboard/_dash-component-suites/dash_daq/dash_daq.min.js.map [GET]
Traceback (most recent call last):
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/dash/dash.py", line 695, in serve_component_suites
    package_name, path_in_package_dist, self.registered_paths
dash.exceptions.DependencyException: "dash_daq" is registered but the path requested is not valid.
The path requested: "dash_daq.min.js.map"
List of registered paths: defaultdict(<class 'set'>, {'dash_renderer': {'polyfill@7.7.0.min.js', 'dash_renderer.min.js.map', 'prop-types@15.7.2.min.js', 'dash_renderer.min.js', 'react@16.8.6.min.js', 'react-dom@16.8.6.min.js'}, 'dash_daq': {'dash_daq.min.js', 'async~slider.js.map', 'async~slider.js', 'async~colorpicker.js', 'async~colorpicker.js.map'}, 'dash_html_components': {'dash_html_components.min.js', 'dash_html_components.min.js.map'}, 'dash_bootstrap_components': {'_components/dash_bootstrap_components.min.js'}, 'dash_table': {'bundle.js.map', 'async~export.js.map', 'async~export.js', 'async~table.js', 'async~table.js.map', 'bundle.js'}, 'dash_core_components': {'async~upload.js', 'async~graph.js.map', 'async~markdown.js.map', 'async~graph.js', 'highlight.pack.js', 'async~datepicker.js.map', 'plotly-1.51.1.min.js', 'async~plotlyjs.js', 'async~plotlyjs.js.map', 'async~dropdown.js', 'async~upload.js.map', 'async~markdown.js', 'dash_core_components.min.js.map', 'async~datepicker.js', 'async~dropdown.js.map', 'dash_core_components.min.js'}})
[2019-11-19 08:34:39 -0700] [18763] [INFO] Handling signal: winch
Exception on /dashboard/_dash-component-suites/dash_daq/dash_daq.min.js.map [GET]
Traceback (most recent call last):
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/dash/dash.py", line 695, in serve_component_suites
    package_name, path_in_package_dist, self.registered_paths
dash.exceptions.DependencyException: "dash_daq" is registered but the path requested is not valid.
The path requested: "dash_daq.min.js.map"
List of registered paths: defaultdict(<class 'set'>, {'dash_renderer': {'polyfill@7.7.0.min.js', 'dash_renderer.min.js.map', 'prop-types@15.7.2.min.js', 'dash_renderer.min.js', 'react@16.8.6.min.js', 'react-dom@16.8.6.min.js'}, 'dash_daq': {'dash_daq.min.js', 'async~slider.js.map', 'async~slider.js', 'async~colorpicker.js', 'async~colorpicker.js.map'}, 'dash_html_components': {'dash_html_components.min.js', 'dash_html_components.min.js.map'}, 'dash_bootstrap_components': {'_c                                                                                   Connection 1 Failed: invalidCredentials

I did some testing with older versions of Dash and noticed that this issue stated with Dash 1.5.0. After reading the release notes for 1.5.0, I found that adding eager_loading=True to my app has resolved the issue:

From Dash 1.5.0 Release Notes:

Lazy-loading can be disabled with app = Dash(__name__, eager_loading=True) , making all async resources load eagerly for the app

@cufflink What version of dash-daq are you using?

@Marc-Andre I’m using dash-daq 0.3.1

@Marc-Andre - I’ll also note, that I’ve seen this error appear in my terminal window a couple of times after setting eager_loading=True. It’s pretty rare, but the page continues to update properly.

Additional note… I am able to reproduce the error even with eager_loading=True by refreshing my page with the developer console (Chrome) showing.

I have also started to see this error… I don’t see any undesired effect of the graphical interface, but i would still like the resolve the issue. I am also running via gunicorn (wrapped in Docker).