weas-widget icon indicating copy to clipboard operation
weas-widget copied to clipboard

Unable to use weas-widget in Vscode

Open muxkin opened this issue 9 months ago • 10 comments

When I tried to use weas-widget in VScode, it tells me that "Click to show javascript error".

Image

And the error was

at WidgetManager.loadClass (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2420023)
    at WidgetManager.loadClass (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2803837)
    at WidgetManager.loadModelClass (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2416808)
    at WidgetManager._make_model (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2414769)
    at WidgetManager.new_model (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2412488)
    at WidgetManager.handle_comm_open (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2411259)
    at https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2802850
    at t._handleCommOpen (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-2024.11.0-win32-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:119358)
    at async t._handleMessage (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-2024.11.0-win32-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:121233)

muxkin avatar Mar 03 '25 06:03 muxkin

Thanks for reporting the issue! Could you try to upgrade the jupyterlab and other related package.

pip install jupyterlab --upgrade

upgrade other package may also help

pip install anywidget --upgrade
pip install widgetsnbextension --upgrade

superstar54 avatar Mar 03 '25 06:03 superstar54

I upgrade the packages above, but It doesn't work.

muxkin avatar Mar 03 '25 11:03 muxkin

Does it work in a normal Jupyter Lab (notebook)?

superstar54 avatar Mar 03 '25 11:03 superstar54

Yes. It works in jupyter lab.

muxkin avatar Mar 03 '25 11:03 muxkin

Please also try

pip install ipywidgets --upgrade

superstar54 avatar Mar 03 '25 12:03 superstar54

If it still doesn't work, please share your package lists.

pip list > packages.txt

I can compare it with mine.

superstar54 avatar Mar 03 '25 12:03 superstar54

My ipywidgets's version is 8.1.5, and "packages.txt" is below. packages.txt

muxkin avatar Mar 03 '25 13:03 muxkin

I tried in another computer(PC2, the computer with trouble called PC1), and it do works in vscode! ipywidgets's version in PC2 is 8.1.5, too. So it must be someone else make it not work in PC1. packages_PC2.txt is below.

packages_PC2.txt

muxkin avatar Mar 03 '25 16:03 muxkin

The second file seems to be a binary, and can not see the details.

superstar54 avatar Mar 04 '25 15:03 superstar54

Yes. It works in jupyter lab.

In this case, the environment should be fine. You could try to upgrade the jupyter extension of the Vscode, or Vscode itself.

superstar54 avatar Mar 04 '25 15:03 superstar54