Hello. When I’m building jlab v3 locally with ipyleaflet==0.13.6 installed it works fine. But when I’m building it on my server machine(docker image jupyter/base-notebook:notebook-6.2.0), I’m getting this error:
Plugin 'jupyter.extensions.jupyter-leaflet' failed to activate. index.es6.js:283 Error: No provider for: jupyter.extensions.jupyterWidgetRegistry. at H.e.resolveRequiredService (VM4234 jlab_core.827d543b8d221fe1180d.js:2) at VM4234 jlab_core.827d543b8d221fe1180d.js:2 at Array.map (<anonymous>) at H.e.activatePlugin (VM4234 jlab_core.827d543b8d221fe1180d.js:2) at VM4234 jlab_core.827d543b8d221fe1180d.js:2 at Array.map (<anonymous>) at H.e.start (VM4234 jlab_core.827d543b8d221fe1180d.js:2) at U (index.out.js:707)
Can someone please provide me with information on what can possibly cause that problem in my situation? Is this packages incompatibility issue? So why then locally everything works like a charm?
I’ve also been running into this issue, with the ipyevents and pywwt extensions. Like @lodka I’ve got sufficiently new ipywidgets and jupyterlab_widgets installed, as well as the @jupyter-widgets/jupyterlab-manager (v3.0.0) extension installed.
What’s frustrating is that I’ve probably solved this problem two or three times in different installations, but I keep on losing track of what I did to get things working. I’m mainly posting to remind myself to actually write the answer down here if/when I figure it out again …
edit Apologies for starting to turn this into a GitHub thread, but in the spirit of writing down my findings … Looks like we have different values for what should be the same token? Debugging Application.resolveRequiredService in my browser:
@jasongrout Ah, ipyevents might not have been updated to express compatibility with @jupyter-widgets/base 4.x. If I have some plugins that call for @jupyter-widgets/base 3.x and others that call for 4.x, might that result in the issue I documented above?
Yes, that is correct. More technically, the Jupyter widgets manager for JLab 3 provides to the system the manager tied to the token from @jupyter-widgets/base version 4. If another widget is requesting the token from base version 3, it won’t find it and complain.
So, if I’m understanding correctly, webpack is including two different versions of @jupyter-widgets/base in the bundle that it’s creating, and that can lead to problems. Is there any workable way to make that an error at the jupyter lab build stage? I can see how it might be tricky, since you wouldn’t want to trigger an error for random UI support libraries — only packages that provide Tokens and similar shared app resources.
First, a lot of this problem goes away with jlab 3 prebuilt extensions (if they are properly built), as it has built-in this mechanism of using whatever jlab base package comes with the system rather than bringing your own.
Back to the combined webpack build for source extensions: we have such a mechanism for core token packages - the notion of “resolutions” where we force everyone to use a single package. However, (IIRC) we don’t have a way right now to have one extension force this on other extensions.
Sort of. First, with jlab 3, we have the main build process, and then separate build processes for each prebuilt extension. I assume you are just talking about the main jlab build process (the one that builds in the source extensions). In that case, the one webpack config used is assembled from all the various source extensions it is building in, and yes, one of those extensions can say that everyone should use a specific version of @jupyter-widgets/base that will be shared among everyone in that one core build. It does not say that prebuilt extensions must use this copy of base (since they will have their own build process with their own webpack config).
The deduplication by the new shared config is more of a cooperative deduplication than a forced deduplication for prebuilt extensions, in that prebuilt extensions must opt into it (and we provide some sensible defaults, like automatically opting into deduplicating core packages, etc.)