ipywidgets icon indicating copy to clipboard operation
ipywidgets copied to clipboard

Widget not rendering on JupyterLab, when starting main.py examples/app and examples/notebook

Open erkin98 opened this issue 3 years ago • 1 comments

Description

Widget not rendering on JupyterLab when running main.py examples/app and examples/notebook

Reproduce

  1. Go to root folder after cloning https://github.com/jupyterlab/jupyterlab
  2. Build examples folder after installing and building all node modules
  3. Go to examples/app, run python main,py , open notebook type and run
import ipywidgets as widgets
widgets.Button(description="Hello")

Screenshot from 2021-10-16 18-17-29

Expected behavior

Screenshot from 2021-10-16 16-33-05

Context

  • ipywidgets version: 7.6.5
  • Operating System and version: Linux Ubuntu 20.04
  • Browser and version: Chrome 94.0.4606.71
  • Nodejs version: 14.17.4
Troubleshoot Output

Command Line Output
Paste the output from your command line running `jupyter lab` (or `jupyter notebook` if you use notebook) here, use `--debug` if possible.
Browser Output
Access to font at 'about:blank' from origin 'http://localhost:8888' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
about:blank:1 Failed to load resource: net::ERR_FAILED
3 default.js:1027 Exception opening new comm
_handleCommOpen @ default.js:1027

If using JupyterLab

  • JupyterLab version: 3.1.18
Installed Labextensions
JupyterLab v3.1.18
/home/erkin98/miniconda3/envs/appshell/share/jupyter/labextensions
        jupyter-leaflet v0.14.0 enabled OK
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab) app dir: /home/erkin98/miniconda3/envs/appshell/share/jupyter/lab jupyterlab-plotly v5.3.1 enabled OK jupyterlab-system-monitor v0.7.0 enabled OK jupyterlab-topbar-extension v0.6.0 enabled OK plotlywidget v4.14.3 enabled OK

erkin98 avatar Oct 18 '21 06:10 erkin98

The part in the browser output seems very relevant:

default.js:1027 Exception opening new comm
_handleCommOpen @ default.js:1027

Unfortunately it seems cut off. Is there more to that output that you could include?

vidartf avatar Nov 03 '21 17:11 vidartf

Looks like I'm able to replicate the issue. Running node version 14.17.4

image

These errors are coming from webpack://jupyterlab/packages/services/lib/kernel/default.js.

image

In particular, the content.target_module and this._targetRegistry. However, this doesn't seem like an ipywidgets issue, rather a JupyterLab issue. Should this be moved to jupyterlab repository?

jmk89 avatar Dec 23 '22 18:12 jmk89

i resolved it by adding jupyterlab-manager to package.json

erkin98 avatar Dec 23 '22 18:12 erkin98