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

Perspective widget does not load in VS Code #15406

Open
s1lvester opened this issue Mar 20, 2024 · 4 comments
Open

Perspective widget does not load in VS Code #15406

s1lvester opened this issue Mar 20, 2024 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets

Comments

@s1lvester
Copy link

s1lvester commented Mar 20, 2024

Edited by Don, as the widget does not load in regular desktop (not just SSH or the like).

Show Logs

Environment data

  • VS Code version: 1.87.2
  • Jupyter Extension version: v2024.2.0
  • Python Extension version: v2024.2.1
  • OS (Windows | Mac | Linux distro) and version: NT x64 10.0.19045 on Client, Ubuntu 20.04 on remote.
  • Python and/or Anaconda version: 3.9.18
  • Type of virtual environment used: N/A
  • Jupyter server running: Remote-SSH

Expected behaviour

Widget-Download from "jupyter.widgetScriptSources": ["jsdelivr.com", "unpkg.com"], should be downloaded locally, when "Download Extensions Locally" is configured in Remote-SSH.

Alternatively vscode-jupyter should use the extension.js from the remote-host from ~/.local/share/jupyter/nbextensions/ or ~/.local/share/jupyter/labextensions/

Actual behaviour

vscode-jupyter tries and fails to download ScriptSources from "jsdelivr.com", "unpkg.com" - which leads to a timeout, since the remote is "airgapped"

In this concrete case the Widget-files in

  • ~/.local/share/jupyter/nbextensions/@finos/perspective-jupyterlab
  • ~/.local/share/jupyter/labextensions/@finos/perspective-jupyterlab

are ignored even though there seems to be logic implemented to search for these as documented here: https://github.com/microsoft/vscode-jupyter/wiki/Component:-IPyWidgets#loading-3rd-party-source

Steps to reproduce:

  1. Install vscode remote-ssh with python and vscode-jupyter.

  2. Configure remote-ssh to download all extensions locally ("remote.downloadExtensionsLocally": true,)
    image

  3. Install and run a python package that uses a Widget - in this case "perspecitve":(https://perspective.finos.org/docs/python/#perspectivewidget)

  4. vscode-jupyter is unable to download from jsdeliver.com and unpkg.com, since the remote has not internet, which leads to a timeout.

2024-03-20 10_18_28-Window

Validation

Widget works fine I when I start a Jupyterlab Server on the Remote Host and Access it via https in a Webbrowser:

2024_03_20_12_00_03_New_Session_mbockhacker_2024_01_KHK_Entlassmedikation_mbockhacker_Cloude

Logs

Output for Jupyter in the Output

10:16:11.925 [info] Process Execution: /usr/local/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2024.2.0/pythonFiles/printJupyterDataDir.py
10:16:13.382 [info] Handle Execution of Cells 0,1,2,3 for ~/notebooks/DEV/DEV-mb.ipynb
10:16:13.388 [info] End cell 0 execution after 0s, completed @ undefined, started @ undefined
10:16:13.499 [info] Kernel acknowledged execution of cell 1 @ 1710926173499
10:16:14.884 [info] End cell 1 execution after 1.384s, completed @ 1710926174883, started @ 1710926173499
10:16:14.896 [info] Kernel acknowledged execution of cell 2 @ 1710926174896
10:16:15.019 [info] End cell 2 execution after 0.123s, completed @ 1710926175019, started @ 1710926174896
10:16:15.031 [info] Kernel acknowledged execution of cell 3 @ 1710926175030
10:16:15.553 [info] �[32mFetch Script for {"moduleName":"@finos/perspective-jupyterlab","moduleVersion":"~2.9.0","requestId":"@finos/perspective-jupyterlab:~2.9.0:1710926175531"}
10:16:15.553 [info] �[32mFetch Script for @finos/perspective-jupyterlab
10:16:15.554 [info] �[32mSearching for Widget Script @finos/perspective-jupyterlab#~2.9.0 using cdns jsdelivr.com unpkg.com
10:16:16.031 [info] End cell 3 execution after 1.001s, completed @ 1710926176031, started @ 1710926175030
10:17:15.553 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
  className: '<class>',
  moduleName: '@finos/perspective-jupyterlab',
  moduleVersion: '~2.9.0',
  isOnline: true,
  timedout: true,
  error: '{}'
}
10:17:15.613 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
  className: 'PerspectiveModel',
  moduleName: '@finos/perspective-jupyterlab',
  moduleVersion: '~2.9.0',
  isOnline: true,
  timedout: false,
  error: '{}'
}
10:18:22.881 [error] Widget Script @finos/perspective-jupyterlab#~2.9.0 was not found on on any cdn
10:18:22.882 [warn] Widget Script Source not found for @finos/perspective-jupyterlab@~2.9.0 from cdn
10:18:22.884 [warn] Widget Script Source not found for @finos/perspective-jupyterlab@~2.9.0 from local
10:18:22.884 [error] Script source for Widget @finos/perspective-jupyterlab@~2.9.0 not found in cdn, local
10:18:22.884 [info] �[32mScript for @finos/perspective-jupyterlab, is undefined from undefined

Output for the Click to show javascript error. Message

Error: No version of module @finos/perspective-jupyterlab is registered
    at ph.loadClass (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4099813)
    at ph.loadClass (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4403287)
    at ph.loadModelClass (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4097773)
    at ph._make_model (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4094616)
    at ph.new_model (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4092246)
    at ph.handle_comm_open (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4091039)
    at https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4402511
    at n._handleCommOpen (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-2024.2.0/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:80955)
    at async n._handleMessage (https://vscode-remote+ssh-002dremote-002bcdsw.vscode-resource.vscode-cdn.net/home/cdsw/.vscode-server/extensions/ms-toolsai.jupyter-2024.2.0/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:82830)

Terminal-Output for the nbextensions and labextensions Directories on the remote server.

cdsw@u8lkaf207dm5tzjv:~$ ls -l ~/.local/share/jupyter/nbextensions/@finos/perspective-jupyterlab
total 10820
-rw-r--r-- 1 cdsw cdsw   90338 Mar 19 10:19 extension.js
-rw-r--r-- 1 cdsw cdsw    4840 Mar 19 10:19 extension.js.map
-rw-r--r-- 1 cdsw cdsw 4610375 Mar 19 10:19 index.js
-rw-r--r-- 1 cdsw cdsw 6363285 Mar 19 10:19 index.js.map
cdsw@u8lkaf207dm5tzjv:~$ ls -l ~/.local/share/jupyter/labextensions/@finos/perspective-jupyterlab
total 12
-rw-r--r-- 1 cdsw cdsw  202 Mar 19 10:19 install.json
-rw-r--r-- 1 cdsw cdsw 2538 Mar 19 10:19 package.json
drwxr-xr-x 2 cdsw cdsw 4096 Mar 19 10:19 static

By the way

I still think this is somewhat related to #14762 because vscode-jupyter could just reference the widget files from the remote-host?

@s1lvester s1lvester added the bug Issue identified by VS Code Team member as probable bug label Mar 20, 2024
@s1lvester s1lvester changed the title vscode-jupyter should be able to download widgets through ssh to the remote-ssh vscode-jupyter should be able to download widgets through ssh to the remote host Mar 20, 2024
@DonJayamanne

This comment was marked as off-topic.

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Mar 21, 2024
@s1lvester

This comment was marked as resolved.

@DonJayamanne DonJayamanne changed the title vscode-jupyter should be able to download widgets through ssh to the remote host Perspective widget does not load in VS Code Mar 27, 2024
@DonJayamanne
Copy link
Contributor

The problem is not remote SSH, perspective widget does not load even in local desktop.
I assumed that it works for desktop and only fails in remote SSH,
However thats not the case

@DonJayamanne DonJayamanne added ipywidgets Rendering, loading, saving, anything to do with IPyWidgets and removed info-needed Issue requires more information from poster labels Mar 27, 2024
@basnijholt
Copy link

basnijholt commented Sep 16, 2024

Edit: my issue is with anywidget (a wrapper around ipywidgets)

I am running into the same issue locally in pipefunc/pipefunc#323:

11:22:17.421 [debug] Requesting Kernel info
11:22:21.637 [debug] Handle Execution of Cells 0 for ~/Work/pipefunc/x.ipynb
11:22:21.645 [debug] Kernel acknowledged execution of cell 0 @ 1726510941645
11:22:22.456 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
  className: 'LayoutModel',
  moduleName: '@jupyter-widgets/base',
  moduleVersion: '2.0.0',
  isOnline: true,
  timedout: false,
  error: '{}'
}
11:22:22.456 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
  className: 'AnyModel',
  moduleName: 'anywidget',
  moduleVersion: '~0.9.*',
  isOnline: true,
  timedout: false,
  error: '{}'
}
11:22:22.457 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
  className: 'LayoutModel',
  moduleName: '@jupyter-widgets/base',
  moduleVersion: '2.0.0',
  isOnline: true,
  timedout: false,
  error: '{}'
}
11:22:22.458 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
  className: 'ButtonStyleModel',
  moduleName: '@jupyter-widgets/controls',
  moduleVersion: '2.0.0',
  isOnline: true,
  timedout: false,
  error: '{}'
}

Is there any workaround @DonJayamanne that you could think of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets
Projects
None yet
Development

No branches or pull requests

3 participants