Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click to show javascript error. Failed to load model class 'DataGridModel' from module 'ipydatagrid' #533

Open
ManPython opened this issue Aug 12, 2024 · 4 comments

Comments

@ManPython
Copy link

Describe the bug

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'DataGridModel' from module 'ipydatagrid'
loadClass@http://jupyter.xx.xx/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.a63a8d293fb35a52dc25.js?v=a63a8d293fb35a52dc25:1:74936
loadModelClass@http://jupyter.xx.xx/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:11349
_make_model@http://jupyter.xx.xx/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:9237
new_model@http://jupyter.xx.xx/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:6734
handle_comm_open@http://jupyter.xx.xx/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:5425
134/v/this._handleCommOpen@http://jupyter.xx.xx/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.a63a8d293fb35a52dc25.js?v=a63a8d293fb35a52dc25:1:73473
_handleCommOpen@http://jupyter.xx.xx/static/lab/jlab_core.2a654e8ce95fad86c235.js?v=2a654e8ce95fad86c235:1:1240940

To Reproduce
Steps to reproduce the behavior:

  1. Trying run example Bar renderer
  2. https://github.com/bloomberg/ipydatagrid/blob/main/examples/DataGrid.ipynb

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Operating System and Version: FreeBSD
  • Browser [e.g. Firefox, Safari] (if applicable): FF

Additional context

Starting application in workspace: "default" index.js:397:16
JupyterLab extension @lckr/jupyterlab_variableinspector is activated! 803.734174c6f9bb29d6a498.js:1:22304
JupyterLab extension jupyterlab-execute-time is activated! 568.ee4868a697ea4b9e5b90.js:1:8273
JupyterLab extension gpt_jupyterlab is activated! 977.960403d3967b615d6a50.js:1:2495
JupyterLab extension jupyterlab_code_formatter is activated! 705.254abada6a4b8e081d74.js:1:7321
Bokeh: BokehJS not loaded, scheduling load and callback at 
Date Mon Aug 12 2024 14:24:13 GMT+0200 (czas środkowoeuropejski letni)
jlab_core.2a654e8ce95fad86c235.js:200:13
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: all BokehJS libraries/stylesheets loaded jlab_core.2a654e8ce95fad86c235.js:206:17
Bokeh: BokehJS plotting callback run at 
Date Mon Aug 12 2024 14:24:13 GMT+0200 (czas środkowoeuropejski letni)
jlab_core.2a654e8ce95fad86c235.js:286:15
[bokeh] setting log level to: 'info' bokeh-2.4.1.min.js:184:1360
Bokeh: all callbacks have finished jlab_core.2a654e8ce95fad86c235.js:184:13
[bokeh] document idle at 221 ms bokeh-2.4.1.min.js:165:1339
Starting WebSocket: ws://jupyter.xx.xx/api/kernels/xx-5e97-460e-9102-d6db6b66b8c5 2 default.js:70:20
Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early manager-base.js:291:20
Error: widget model not found
   get_model manager-base.js:128
   renderModel 134.a63a8d293fb35a52dc25.js:1
134.a63a8d293fb35a52dc25.js:1:72266
Error: No version of module bqplot is registered
   loadClass 134.a63a8d293fb35a52dc25.js:1
   loadModelClass manager-base.js:570
   _make_model manager-base.js:402
   new_model manager-base.js:245
   handle_comm_open manager-base.js:155
   _handleCommOpen 134.a63a8d293fb35a52dc25.js:1
   _handleCommOpen default.js:1119
manager-base.js:575:20
Error: No version of module bqplot is registered
   loadClass 134.a63a8d293fb35a52dc25.js:1
   loadModelClass manager-base.js:570
   _make_model manager-base.js:402
   new_model manager-base.js:245
   handle_comm_open manager-base.js:155
   _handleCommOpen 134.a63a8d293fb35a52dc25.js:1
   _handleCommOpen default.js:1119
manager-base.js:575:20
Error: No version of module ipydatagrid is registered
   loadClass 134.a63a8d293fb35a52dc25.js:1
   loadModelClass manager-base.js:570
   _make_model manager-base.js:402
   new_model manager-base.js:245
   handle_comm_open manager-base.js:155
   _handleCommOpen 134.a63a8d293fb35a52dc25.js:1
   _handleCommOpen default.js:1119
manager-base.js:575:20
Error: No version of module ipydatagrid is registered
   loadClass 134.a63a8d293fb35a52dc25.js:1
   loadModelClass manager-base.js:570
   _make_model manager-base.js:402
   new_model manager-base.js:245
   handle_comm_open manager-base.js:155
   _handleCommOpen 134.a63a8d293fb35a52dc25.js:1
   _handleCommOpen default.js:1119
manager-base.js:575:20
Error: No version of module ipydatagrid is registered
   loadClass 134.a63a8d293fb35a52dc25.js:1
   loadModelClass manager-base.js:570
   _make_model manager-base.js:402
   new_model manager-base.js:245
   handle_comm_open manager-base.js:155
   _handleCommOpen 134.a63a8d293fb35a52dc25.js:1
   _handleCommOpen default.js:1119
manager-base.js:575:20
Kernel: restarting (xx-5e97-460e-9102-d6db6b66b8c5) default.js:1371:24
Connection lost, reconnecting in 0 seconds. default.js:1326:20
Starting WebSocket: ws://jupyter.xx.xx/api/kernels/xx-5e97-460e-9102-d6db6b66b8c5 default.js:70:20
TypeError: this is undefined
   isReady notebooklspadapter.js:184
   C utils.js:22
   C utils.js:20
   onKernelChanged notebooklspadapter.js:146
   m index.es6.js:555
   l index.es6.js:513
   emit index.es6.js:112
   restartKernel sessioncontext.js:366
notebooklspadapter.js:160:20
Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early manager-base.js:291:20
Bokeh: BokehJS not loaded, scheduling load and callback at 
Date Mon Aug 12 2024 14:24:46 GMT+0200 (czas środkowoeuropejski letni)
jlab_core.2a654e8ce95fad86c235.js:200:13
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
Bokeh: injecting script tag for BokehJS library:  https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.1.min.js jlab_core.2a654e8ce95fad86c235.js:234:15
@b73f9
Copy link

b73f9 commented Oct 13, 2024

I think this is somehow related to bqplot issues (hitting the same problem - seeing jupyterlab try to load ipydatagrid, but then failing on missing bqplot; if i try to rebuild the thing with bqplot, i get the following build error)

[LabBuildApp] > node /usr/lib/python3.12/site-packages/jupyterlab/staging/yarn.js run build:prod
[LabBuildApp] [webpack-cli] Failed to load '/usr/share/jupyter/lab/staging/webpack.prod.config.js' config
[webpack-cli] Invalid options object. Module Federation Plugin has been initialized using an options object that does not match the API schema.
 - options.shared should be one of these:
   [non-empty string | object { <key>: object { eager?, import?, packageName?, requiredVersion?, shareKey?, shareScope?, singleton?, strictVersion?, version? } | non-empty string }, ...] | object { <key>: object { eager?, import?, packageName?, requiredVersion?, shareKey?, shareScope?, singleton?, strictVersion?, version? } | non-empty string }
   -> Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
   Details:
    * options.shared['d3-selection'].import should be one of these:
      false | non-empty string
      -> Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
      Details:
       * options.shared['d3-selection'].import should be false.
         -> No provided or fallback module.
       * options.shared['d3-selection'].import should be a non-empty string.
         -> A module that should be shared in the share scope.

[LabBuildApp] JupyterLab failed to build
[LabBuildApp] ERROR | Build failed.

Not entirely sure where to go from there for now.

@b73f9
Copy link

b73f9 commented Oct 13, 2024

Ah, looks like the d3-selection js module that bqplot depends on has gotten too old for the current webpack version jupyterlab uses, which seems to cause the above error. fwiw locally modifying bqplot to depend on ^2 rather than ^1 versions of d3-selection (and then manually installing it in develop mode into jupyter) seems to solve the above problem for me:

diff --git a/js/package.json b/js/package.json
index a9e6d948..e03a7a12 100644
--- a/js/package.json
+++ b/js/package.json
@@ -83,7 +83,7 @@
     "@lumino/widgets": "^1 || ^2",
     "bqscales": "^0.3.2",
     "d3": "^5.7.0",
-    "d3-selection": "^1",
+    "d3-selection": "^2",
     "is-typedarray": "^1.0.0",
     "kiwi.js": "^1.1.2",
     "popper.js": "^1.0.0",

@b73f9
Copy link

b73f9 commented Oct 13, 2024

I'm not sure if that's not going to break something else... but seems to be fine for now.

@martinRenou
Copy link
Member

if i try to rebuild the thing with bqplot, i get the following build error)

That does not sound correct.

The official way of installing bqplot and ipydatagrid today is to pip install bqplot ipydatagrid and nothing else. There is nothing to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants