Dash_ag_grid registration to Python Dash

Hi all,
we receive this error running our Python dash application in Production:

INFO:werkzeug:10.190.39.2 - - [27/Feb/2024 17:07:08] “POST /_dash-update-component HTTP/1.1” 200 -
INFO:werkzeug:10.190.40.2 - - [27/Feb/2024 17:07:08] “POST /_dash-update-component HTTP/1.1” 200 -
ERROR:app:Exception on /_dash-component-suites/dash_ag_grid/dash_ag_grid.min.js.map [GET]
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/flask/app.py”, line 1463, in wsgi_app
response = self.full_dispatch_request()
File “/usr/local/lib/python3.9/site-packages/flask/app.py”, line 872, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/local/lib/python3.9/site-packages/flask_cors/extension.py”, line 176, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File “/usr/local/lib/python3.9/site-packages/flask/app.py”, line 870, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/local/lib/python3.9/site-packages/flask/app.py”, line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File “/usr/local/lib/python3.9/site-packages/dash/dash.py”, line 947, in serve_component_suites
_validate.validate_js_path(self.registered_paths, package_name, path_in_pkg)
File “/usr/local/lib/python3.9/site-packages/dash/_validate.py”, line 365, in validate_js_path
raise exceptions.DependencyException(
dash.exceptions.DependencyException: Error loading dependency. “dash_ag_grid” is not a registered library.
Registered libraries are:
[‘dash’, ‘dash_bootstrap_components’, ‘plotly’]

What does library registration mean here and how do you think I can resolve this?

HI @231530353 and welcome to the Dash community :slight_smile:

If you are using dash 2.16.0, then updating to 2.16.1 should fix this issue.

Thanks @AnnMarieW …We are using 2.15.0, can it be the reason?

Hi @231530353

The 2.15 version should cause this. Can you give more information or provide a minimal example that reproduces the error?

Sure, before doing so, I tried to upgrade to 2.16.1 … as I can see in the dash code: dash/dash/dash.py at dev · plotly/dash · GitHub
dash uses importlib_metadata, and that causes this error when I run my code after the upgrade:
ModuleNotFoundError: No module named ‘importlib_metadata’

but based on importlib_metadata 7.0.3.dev0+g913352a.d20240307 documentation users are encouraged to use the Python standard library where suitable and fall back to this library for future compatibility, as follows:

try:
# For Python 3.8 and later
from importlib.metadata import version as _get_distribution_version
except ImportError:
# For everyone else
from importlib_metadata import version as _get_distribution_version

any thoughts?

Hello @231530353,

Just checking, did you actually install dash-ag-grid? It is not included with dash automatically.

we did, version 31.0.1