I've been dealing with this problem the past few days. I've scoured past issues and tried all of the different solutions, but none of them have worked for me. I'm running JupyterLab on a remote server running Ubuntu Server 18.04 which I connect to through local port forwarding using Chrome.
import ipywidgets as widgets
widgets.IntSlider()
Results in "Loading widget..." without actually displaying the widget.

When I inspect the chrome console I see a number of errors like this.

I've tried using my default pip environment and an anaconda environment. Both have resulted in the same thing. When I run the code as an ipynb in standard Jupyter, I am able to see the widget. Any advice here?
Relevant info:
Remote Server: Ubuntu Server 18.04
Local: Windows 10 using Chrome
jupyter core: 4.6.1
jupyter notebook: 6.0.2
jupyter lab: 1.2.3
ipywidgets: 7.5.1
nodejs: 8.10.0
What ipywidgets jlab extension do you have installed? jupyter labextension list
See https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension
I knew I was missing one.
@jupyter-widgets/jupyterlab-manager v1.1.0
That's what you have installed? Or you were missing it and now it works great?
"jupyter.widget not found in registry" indicates that the jlab extension did not get set up correctly.
That's what I have. It still doesn't work. I've followed that document you referenced before.

I would concentrate on making sure the jlab extension is installed and working properly. What other extensions do you have installed? Can you uninstall it, jupyter lab clean, and jupyter labextension install it again? Are you sure that this is the version of jlab that you are running?
I've tried doing that a few times as well. I did it again and included the console output below. Do you see anything off?

I'm still having the same loading issue.
That looks okay to me. Are there any other js errors before the ones you posted here that give an indication as to why it isn't loading properly?
This is everything in the Chrome console. This happens on two different PCs that I've been using to connect to the remote server in case that helps.

The same issue occurs in both Firefox and Edge.
The next thing I would do is use the browser debugger to put a breakpoint in the js source for the widget extension to make sure it was loading.
Just curious - if you create a completely fresh environment with just lab and widgets installed, does it work?
Just curious - if you create a completely fresh environment with just lab and widgets installed, does it work?
I just tried this with the same result.
The next thing I would do is use the browser debugger to put a breakpoint in the js source for the widget extension to make sure it was loading.
Where exactly should I put the breakpoint and how will I know if it loads? I'm not too familiar with the js source. I'm assuming it's in here somewhere.

For what it's worth, I tried installing Jupyter Lab and widgets on two other machines (all through Anaconda) and it results is the same. Here are the steps I've followed to install.
conda activate base
conda install -c conda-forge jupyterlab ipywidgets nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-managerjupyter labimport ipywidgets as widget
widget.IntSlider()
This results in "Loading widget..." and the js errors above for all machines that I've tested. Have I missed something in my installation method?
I experience the same issue using a fresh conda environment using
jupyterlab = 1.2.5
ipywidgets = 7.5.1
@jupyter-widgets/jupyterlab-manager = 1.1.0
Same behavior when using an older version of jupyterlab:
jupyterlab = 1.0.2
ipywidgets = 7.5.1
@jupyter-widgets/jupyterlab-manager = 1.0.3
I got the same issue with jlab:
ipywidgets 7.5.1 py_0 conda-forge
jupyter_client 5.3.4 py37_1 conda-forge
jupyter_core 4.6.1 py37_0 conda-forge
jupyterlab 1.2.6 py_0 conda-forge
jupyterlab_server 1.0.6 py_0 conda-forge
nodejs 11.14.0 he1b5a44_1 conda-forge
notebook 6.0.3 py37_0 conda-forge
(base) xd@xd-ubuntu:~$ jupyter labextension list
JupyterLab v1.2.6
Known labextensions:
app dir: /home/xd/anaconda3/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager v1.1.0 enabled OK
jupyter-matplotlib v0.5.0 enabled OK
Uninstalled core extensions:
@jupyter-widgets/jupyterlab-manager
ipyvolume
jupyter-matplotlib
These Uninstalled core extensions appears to be created by GUI extension manager. I don't know how to completely remove them, even with reinstalling jupyter.
I'm still experiencing the same problem. @jasongrout anything we can provide that would be helpful?
Within my browser, open a Python3 console and run
Ah, that's the issue. The console doesn't support widgets, just the notebook.
So two questions come up for me:
If you (or anyone else) would like to help in these things, we can help you get started.
Within my browser, open a Python3 console and run
Ah, that's the issue. The console doesn't support widgets, just the notebook.
Ahhh...that was it. I put it all into a notebook and I can see the widgets properly.
2. Alternatively (or rather, in addition), the console really should support widgets. There's no real reason it can't, someone just has to expose the widget manager to the console.
What would this require? I don't have a whole lot of time. I'm in the last year of my Ph.D. so I'm a bit limited in what I can do, but I'd be happy to help provide information if someone else wants to take the lead.
I switched to notebook and widgets are ok now.
But in jupyter lab widgets still don't work.
I'm not using console.
@christasich - I'll open issues for the two questions I raised above. Glad we got to the bottom of this issue you raised!
@xiedidan - this issue is about widgets not working in the console. Can you open another issue, since apparently it is a different problem? From your comment above, it seems it is related to the jlab widgets extension being uninstalled?
We are already discussing ipywidgets support for the jlab code console at #2370.
Just to confirm I have the same issue, not working in jupyter lab but working in notebook
Most helpful comment
Just to confirm I have the same issue, not working in jupyter lab but working in notebook