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

Can't use anywidget in latest jupyterlite? #534

Closed
bmaranville opened this issue Apr 9, 2024 · 4 comments
Closed

Can't use anywidget in latest jupyterlite? #534

bmaranville opened this issue Apr 9, 2024 · 4 comments

Comments

@bmaranville
Copy link

Steps to reproduce:

image

Javascript error:

Error: No version of module anywidget is registered
    loadClass 134.fe2572ece3b7955c89bb.js:1
    loadModelClass 336.0a90bd910629a565bb7e.js:1
    _make_model 336.0a90bd910629a565bb7e.js:1
    new_model 336.0a90bd910629a565bb7e.js:1
    handle_comm_open 336.0a90bd910629a565bb7e.js:1
    _handleCommOpen 134.fe2572ece3b7955c89bb.js:1
    _handleCommOpen 6591.94ed352.js:1
    _handleMessage 6591.94ed352.js:1
    _msgChain 6591.94ed352.js:1
    promise callback*87269/v/this._onWSMessage 6591.94ed352.js:1
    dispatchEvent 1079.cdbaf67.js:1
    dispatchEvent 1079.cdbaf67.js:1
    get 1079.cdbaf67.js:1
    sendMessage 2546.e7c3d46.js:1
    sendMessage 2546.e7c3d46.js:1
    handleComm 2546.e7c3d46.js:1
    _processWorkerMessage kernel.js:128
    onmessage kernel.js:19
    H kernel.js:19
    create index.js:56
    startNew 2546.e7c3d46.js:1
    restart 2546.e7c3d46.js:1
    activate 4931.6e96009.js:1
    route 1245.cbc7a54.js:1
    fetch 1245.cbc7a54.js:1
    handleRequest 6591.94ed352.js:1
    makeRequest 6591.94ed352.js:1
    restartKernel 6591.94ed352.js:1
    restart 6591.94ed352.js:1
    restartKernel 6623.ae3b3cc.js:2
    restart 6623.ae3b3cc.js:2
    execute 4875.375150e.js:1
    execute 8061.cc62561.js:1
    onClick 6623.ae3b3cc.js:2
    onMouseDown 6623.ae3b3cc.js:2
    Be 2287.997c38e.js:2
    Ke 2287.997c38e.js:2
    Pr 2287.997c38e.js:2
    Pr 2287.997c38e.js:2
    Nr 2287.997c38e.js:2
    Rr 2287.997c38e.js:2
    De 2287.997c38e.js:2
    Rr 2287.997c38e.js:2
    Rr 2287.997c38e.js:2
    Zn 2287.997c38e.js:2
    Jn 2287.997c38e.js:2
    unstable_runWithPriority 2287.997c38e.js:2
    Hl 2287.997c38e.js:2
    Me 2287.997c38e.js:2
    Xn 2287.997c38e.js:2
[336.0a90bd910629a565bb7e.js:1:10779](https://jupyter.org/try-jupyter/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e)

@manzt
Copy link
Owner

manzt commented Apr 9, 2024

Thanks for trying out anywidget. It works in JupyterLite, but it must be installed in JupyterLite distribution (and not within the running notebook). i.e., you can't %pip install anywidget without anywidget already being installed. This is related to #385.

@jtpio has compiled a version of JupyterLite where this is working. You can try it out here. The issue is that the %pip install anywidget command is out of date and needs to be %pip install anywidget==0.9.2 to sync with the correct version the build @jtpio created used.

@jtpio, I wonder if it would be possible to use a CDN-based HTMLManager in JupyterLite, to avoid this issue (and allow users to install different version of anywidget).

@bmaranville
Copy link
Author

Thanks! I'll be setting up my own deployment following the example of @jtpio

@jtpio
Copy link
Contributor

jtpio commented Apr 10, 2024

I wonder if it would be possible to use a CDN-based HTMLManager in JupyterLite, to avoid this issue (and allow users to install different version of anywidget).

Not sure it's possible at the moment, as it might need something like jupyterlab/jupyterlab#8866, or more generally a way to load plugins from remote places.

@manzt manzt closed this as completed Apr 10, 2024
@manzt
Copy link
Owner

manzt commented Apr 10, 2024

Specifically, I was wondering if I could try to swap something alternative to https://github.com/jupyter-widgets/ipywidgets/tree/b78de43e12ff26e4aa16e6e4c6844a7c82a8ee1c/python/jupyterlab_widgets

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