Widgets showing as text in JupyterLab 4.x

Hi,

I’ve seen this issue come across on several forums, though none of the solutions mentioned there seem to have worked for me.

When trying to visualise a simple widget in Jupyterlab 4.5.6 I get text as output:

import ipywidgets as widgets

widgets.IntSlider()

returns IntSlider(value=0) instead of a slider.

Below are my installed packages and lab extensions.

anyio                     4.13.0
argon2-cffi               25.1.0
argon2-cffi-bindings      25.1.0
arrow                     1.4.0
asttokens                 3.0.1
async-lru                 2.3.0
attrs                     26.1.0
babel                     2.18.0
beautifulsoup4            4.14.3
bleach                    6.3.0
certifi                   2026.2.25
cffi                      2.0.0
charset-normalizer        3.4.7
colorama                  0.4.6
comm                      0.2.3
debugpy                   1.8.20
decorator                 5.2.1
defusedxml                0.7.1
executing                 2.2.1
fastjsonschema            2.21.2
fqdn                      1.5.1
h11                       0.16.0
httpcore                  1.0.9
httpx                     0.28.1
idna                      3.11
ipykernel                 7.2.0
ipython                   9.12.0
ipython_pygments_lexers   1.1.1
ipywidgets                8.1.8
isoduration               20.11.0
jedi                      0.19.2
Jinja2                    3.1.6
json5                     0.14.0
jsonpointer               3.1.1
jsonschema                4.26.0
jsonschema-specifications 2025.9.1
jupyter                   1.1.1
jupyter_client            8.8.0
jupyter-console           6.6.3
jupyter_core              5.9.1
jupyter-events            0.12.0
jupyter-lsp               2.3.1
jupyter_server            2.17.0
jupyter_server_terminals  0.5.4
jupyterlab                4.5.6
jupyterlab_pygments       0.3.0
jupyterlab_server         2.28.0
jupyterlab_widgets        3.0.16
lark                      1.3.1
MarkupSafe                3.0.3
matplotlib-inline         0.2.1
mistune                   3.2.0
nbclient                  0.10.4
nbconvert                 7.17.1
nbformat                  5.10.4
nest-asyncio              1.6.0
notebook                  7.5.5
notebook_shim             0.2.4
packaging                 26.1
pandocfilters             1.5.1
parso                     0.8.6
pip                       23.2.1
platformdirs              4.9.6
prometheus_client         0.25.0
prompt_toolkit            3.0.52
psutil                    7.2.2
pure_eval                 0.2.3
pycparser                 3.0
Pygments                  2.20.0
python-dateutil           2.9.0.post0
python-json-logger        4.1.0
pywinpty                  3.0.3
PyYAML                    6.0.3
pyzmq                     27.1.0
referencing               0.37.0
requests                  2.33.1
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rfc3987-syntax            1.1.0
rpds-py                   0.30.0
Send2Trash                2.1.0
setuptools                82.0.1
six                       1.17.0
soupsieve                 2.8.3
stack-data                0.6.3
terminado                 0.18.1
tinycss2                  1.4.0
tornado                   6.5.5
traitlets                 5.14.3
typing_extensions         4.15.0
tzdata                    2026.1
uri-template              1.3.0
urllib3                   2.6.3
wcwidth                   0.6.0
webcolors                 25.10.0
webencodings              0.5.1
websocket-client          1.9.0
widgetsnbextension        4.0.15

JupyterLab v4.5.6
jupyterlab_pygments v0.3.0 enabled ok (python, jupyterlab_pygments)
@jupyter-notebook/lab-extension v7.5.5 enabled ok
@jupyter-widgets/jupyterlab-manager v5.0.15 enabled ok

Without:

  • the platform
  • the install mechanism (e.g. pip/uv with/without user, conda/mamba/pixi)
  • some browser/server network logs

…it’s hard to diagnose further.

Interesting. I see the same “Intslider(value=0)” output when showing the widget from the kernel-output example. But when showing it directly in the jupyterlab notebook, it is rendered correctly. Also with the sidebar extension instead of the kernel-output example, it is rendered correctly.

Same jupyterlab 4.5.6.

See Ipywidget in kernel-output extension doesn't work

I’m not sure ‘Interesting’ is how to describe it. Any time ipywidgets rendering is not accomplished, the default representation is like that. You can see this in lots of static examples of previously-run notebooks in nbviewer. In the case of static versions if the previously-run notebooks there is no active kernel so it is showing the representation of the output portion of the cell in the stored .ipynb file.

Related examples:

  • bottom cell here (Github version of that in case nbviewer is busy: here ) See the same text towards the bottom of the raw previously-run .ipynb file here
  • cells here (see the Github versions here if nbviewer is being glitchy at the moment, like at present) The same text seen in the raw text of the .ipynb file is what is getting show in the output area of the static representation of the Jupyter notebook file where there is no active kernel involved.

Hi, thank you for your reply and apologies for not providing all information up front.

  • I’m working in Windows, from a venv in PyCharm Community 2023.3.4
  • Everything was installed through pip from the terminal
  • I now see that the log contained several errors:
    Failed to load resource: the server responded with a status of 404 (Not Found)
    :8888/lab:1 Refused to execute script from ‘``http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/remoteEntry.9077b3d2deaffb329dfc.js’`` because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
    main.60c74ae570d773ed6e71.js?v=60c74ae570d773ed6e71:1 Event
    (anonymous) @ main.60c74ae570d773ed6e71.js?v=60c74ae570d773ed6e71:1
    6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1 Failed to create module: package: @jupyter-widgets/jupyterlab-manager; module: ./extension
    D @ 6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1
    6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1 TypeError: Cannot read properties of undefined (reading ‘get’)
    at D (6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1:949)
    at 6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1:2852
    at Array.forEach ()
    at W (6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1:2801)
    (anonymous) @ 6180.42899fcce4dd3bb28bc4.js?v=42899fcce4dd3bb28bc4:1
    3jlab_core.4dbfff320e72a6aecd81.js?v=4dbfff320e72a6aecd81:1
    Exception opening new comm
    _handleCommOpen @ jlab_core.4dbfff320e72a6aecd81.js?v=4dbfff320e72a6aecd81:1
    3jlab_core.4dbfff320e72a6aecd81.js?v=4dbfff320e72a6aecd81:1 Exception opening new comm

After some more searching the most probable issue is that my venv was installed on a network drive… I will try installing everything on a local drive and report back.