Open metasim opened 4 years ago
Some additional debugging...
FWIW. I got the error to occur in my local (MacOS) environment somehow, after a jupyter lab build
and a refresh. Not just a Docker environment thing, pointing to some non-determinism in the startup sequence. The following might further support that theory,.
I set an exception breakpoint and note that the problem starts in Application.activatePlugin
method from the @phosphor
library, when it isjupyter.extensions.jupyter-leaflet
turn to initialize. It comes at the end of a long list of plugins (below), but before @jupyter-widgets/jupyterlab-manager:plugin
. Not sure if this means the system is attempting to initialize jupyter-leaflet
before jupyterlab-manager
, but that's the next thing to investigate, followed by what defines the initialization order.
Application._pluginMap
@jupyterlab/javascript-extension:factory: {id: "@jupyterlab/javascript-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/json-extension:factory: {id: "@jupyterlab/json-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/pdf-extension:factory: {id: "@jupyterlab/pdf-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/vega4-extension:factory: {id: "@jupyterlab/vega4-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/vega5-extension:factory: {id: "@jupyterlab/vega5-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application:mimedocument: {id: "@jupyterlab/application:mimedocument", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:main: {id: "@jupyterlab/application-extension:main", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:layout: {id: "@jupyterlab/application-extension:layout", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:router: {id: "@jupyterlab/application-extension:router", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:tree: {id: "@jupyterlab/application-extension:tree", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:notfound: {id: "@jupyterlab/application-extension:notfound", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:faviconbusy: {id: "@jupyterlab/application-extension:faviconbusy", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:sidebar: {id: "@jupyterlab/application-extension:sidebar", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:shell: {id: "@jupyterlab/application-extension:shell", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:status: {id: "@jupyterlab/application-extension:status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/application-extension:info: {id: "@jupyterlab/application-extension:info", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:paths: {id: "@jupyterlab/apputils-extension:paths", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:palette: {id: "@jupyterlab/apputils-extension:palette", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:palette-restorer: {id: "@jupyterlab/apputils-extension:palette-restorer", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:resolver: {id: "@jupyterlab/apputils-extension:resolver", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:settings: {id: "@jupyterlab/apputils-extension:settings", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:state: {id: "@jupyterlab/apputils-extension:state", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:splash: {id: "@jupyterlab/apputils-extension:splash", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:themes: {id: "@jupyterlab/apputils-extension:themes", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:themes-palette-menu: {id: "@jupyterlab/apputils-extension:themes-palette-menu", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:print: {id: "@jupyterlab/apputils-extension:print", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/codemirror-extension:commands: {id: "@jupyterlab/codemirror-extension:commands", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/codemirror-extension:services: {id: "@jupyterlab/codemirror-extension:services", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/codemirror-extension:editor-syntax-status: {id: "@jupyterlab/codemirror-extension:editor-syntax-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/completer-extension:manager: {id: "@jupyterlab/completer-extension:manager", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/completer-extension:consoles: {id: "@jupyterlab/completer-extension:consoles", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/completer-extension:notebooks: {id: "@jupyterlab/completer-extension:notebooks", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/completer-extension:files: {id: "@jupyterlab/completer-extension:files", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/console-extension:factory: {id: "@jupyterlab/console-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/console-extension:tracker: {id: "@jupyterlab/console-extension:tracker", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/console-extension:foreign: {id: "@jupyterlab/console-extension:foreign", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/csvviewer-extension:csv: {id: "@jupyterlab/csvviewer-extension:csv", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/csvviewer-extension:tsv: {id: "@jupyterlab/csvviewer-extension:tsv", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/docmanager-extension:plugin: {id: "@jupyterlab/docmanager-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/docmanager-extension:path-status: {id: "@jupyterlab/docmanager-extension:path-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/docmanager-extension:saving-status: {id: "@jupyterlab/docmanager-extension:saving-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/documentsearch:plugin: {id: "@jupyterlab/documentsearch:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/documentsearch:labShellWidgetListener: {id: "@jupyterlab/documentsearch:labShellWidgetListener", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/extensionmanager-extension:plugin: {id: "@jupyterlab/extensionmanager-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/filebrowser-extension:factory: {id: "@jupyterlab/filebrowser-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/filebrowser-extension:browser: {id: "@jupyterlab/filebrowser-extension:browser", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/filebrowser-extension:share-file: {id: "@jupyterlab/filebrowser-extension:share-file", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/filebrowser-extension:file-upload-status: {id: "@jupyterlab/filebrowser-extension:file-upload-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/fileeditor-extension:plugin: {id: "@jupyterlab/fileeditor-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/fileeditor-extension:tab-space-status: {id: "@jupyterlab/fileeditor-extension:tab-space-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/help-extension:plugin: {id: "@jupyterlab/help-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/htmlviewer-extension:plugin: {id: "@jupyterlab/htmlviewer-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} jupyter.extensions.hub-extension: {id: "jupyter.extensions.hub-extension", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/apputils-extension:connectionlost: {id: "@jupyterlab/apputils-extension:connectionlost", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/imageviewer-extension:plugin: {id: "@jupyterlab/imageviewer-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/inspector-extension:inspector: {id: "@jupyterlab/inspector-extension:inspector", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/inspector-extension:consoles: {id: "@jupyterlab/inspector-extension:consoles", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/inspector-extension:notebooks: {id: "@jupyterlab/inspector-extension:notebooks", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/launcher-extension:plugin: {id: "@jupyterlab/launcher-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/logconsole-extension:plugin: {id: "@jupyterlab/logconsole-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} logconsole:nboutput: {id: "logconsole:nboutput", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/mainmenu-extension:plugin: {id: "@jupyterlab/mainmenu-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/markdownviewer-extension:plugin: {id: "@jupyterlab/markdownviewer-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/mathjax2-extension:plugin: {id: "@jupyterlab/mathjax2-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/notebook-extension:factory: {id: "@jupyterlab/notebook-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/notebook-extension:tracker: {id: "@jupyterlab/notebook-extension:tracker", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/notebook-extension:tools: {id: "@jupyterlab/notebook-extension:tools", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/notebook-extension:mode-status: {id: "@jupyterlab/notebook-extension:mode-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/notebook-extension:trust-status: {id: "@jupyterlab/notebook-extension:trust-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/rendermime-extension:plugin: {id: "@jupyterlab/rendermime-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/running-extension:plugin: {id: "@jupyterlab/running-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/settingeditor-extension:plugin: {id: "@jupyterlab/settingeditor-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/shortcuts-extension:plugin: {id: "@jupyterlab/shortcuts-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/shortcuts-extension:shortcuts: {id: "@jupyterlab/shortcuts-extension:shortcuts", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/statusbar-extension:plugin: {id: "@jupyterlab/statusbar-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/statusbar-extension:line-col-status: {id: "@jupyterlab/statusbar-extension:line-col-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/statusbar-extension:kernel-status: {id: "@jupyterlab/statusbar-extension:kernel-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/statusbar-extension:running-sessions-status: {id: "@jupyterlab/statusbar-extension:running-sessions-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/statusbar-extension:memory-usage-status: {id: "@jupyterlab/statusbar-extension:memory-usage-status", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/tabmanager-extension:plugin: {id: "@jupyterlab/tabmanager-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/terminal-extension:plugin: {id: "@jupyterlab/terminal-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/theme-dark-extension:plugin: {id: "@jupyterlab/theme-dark-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/theme-light-extension:plugin: {id: "@jupyterlab/theme-light-extension:plugin", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/tooltip-extension:manager: {id: "@jupyterlab/tooltip-extension:manager", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/tooltip-extension:consoles: {id: "@jupyterlab/tooltip-extension:consoles", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/tooltip-extension:notebooks: {id: "@jupyterlab/tooltip-extension:notebooks", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/tooltip-extension:files: {id: "@jupyterlab/tooltip-extension:files", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/ui-components-extension:default-icon-registry: {id: "@jupyterlab/ui-components-extension:default-icon-registry", service: null, promise: Promise, activated: false, activate: ƒ, …} @jupyterlab/vdom-extension:factory: {id: "@jupyterlab/vdom-extension:factory", service: null, promise: Promise, activated: false, activate: ƒ, …} jupyter.extensions.jupyter-leaflet: {id: "jupyter.extensions.jupyter-leaflet", service: null, promise: null, activated: false, activate: ƒ, …} matplotlib-jupyter:main: {id: "matplotlib-jupyter:main", service: null, promise: null, activated: false, activate: ƒ, …} @jupyter-widgets/jupyterlab-manager:plugin: {id: "@jupyter-widgets/jupyterlab-manager:plugin", service: null, promise: null, activated: false, activate:
The below confirms jupyter.extensions.jupyterWidgetRegistry
is provided by jupyterlab-manager
.
I can't see why order should matter, as the registration and initialization phases are distinct. The puzzling thing is that from inspecting the stack variables, it's not clear why the lookup is failing.
The exception is thrown in Application.resolveRequiredService
:
Application.prototype.resolveRequiredService = function (token) {
// Reject the promise if there is no provider for the type.
var id = this._serviceMap.get(token);
if (!id) {
return Promise.reject(new Error("No provider for: " + token.name + "."));
}
// Resolve immediately if the plugin is already activated.
var data = this._pluginMap[id];
if (data.activated) {
return Promise.resolve(data.service);
}
// Otherwise, activate the plugin and wait on the results.
return this.activatePlugin(id).then(function () { return data.service; });
};
token.name
is "jupyter.extensions.jupyterWidgetRegistry"
.this._serviceMap
is the Token provider with that name:get
method doesn't find it 😠I'm not a native JavaScript speaker, so perhaps this makes sense to others (i.e. get
uses identity and not logical equality for lookup), but it feels odd.
I think I had a breakthrough... the Token
types are coming from two different libraries. I'm using Jupyter 1.2.6, which uses the @phosphor
library, and ipyleaflet seems to be assuming we're running in Jupyter 2.0, under the new
jupyterlab-manager
token:
jupyter-leaflet
token:
Woaw. Thanks a lot for all this debugging. @jasongrout are you aware of this issue?
According to this, the version of JupyterLab specifies the version of jupyterlab-manager
you should use:
Not sure how the jupyter-widgets/base
version maps to the jupyter-widget/jupyterlab-manager
version but in 0.12.3
it was changed to "@jupyter-widgets/base": "^2 || ^3",
from just "@jupyter-widgets/base": "^2.0",
in 0.12.2.
Should this be considered a breaking change for JupyterLab 1.2.x users?
Confirmation: I pinned the following versions and things are now working 😅 :
@jupyter-widgets/jupyterlab-manager@1.1
ipyleaflet==0.12.2
jupyter-leaflet@0.12.2
@martinRenou @jasongrout Not sure if you consider this a bug or a need for compatibility documentation? I suspect this will be one of a huge number of plugins that break from JupyterLab 1.2.x -> 2.x. I'd suggest releasing 0.12.4 that works with 1.2.x, and then release 0.13.0 with the migration to JL 2.x.
@martinRenou Any chance the changes in the 0.12.x lineage could be release in a form compatible with JupyterLab 1.2.x? We just can't upgrade to JL 2.x due to other plugins not being there yet.
0.12.x should work with JupyterLab 1.2.x.
Actually I tried that combination yesterday and it was working just fine. Are you not seing it work? Also another question, are you by any change using ipyvolume as well?
@martinRenou No, I'm not using ipyvolume
.
Last time I was trying this out was when 0.12.3
was the latest. I see you're now up to 0.12.6, so I'll give that a spin.
@martinRenou I just rebuilt with 0.12.6
and I'm back to the Error displaying widget: model not found
message in the Jupyter output cell. In the browser console the error is Uncaught (in promise) Error: Module jupyter-leaflet, semver range ^0.12.6 is not registered as a widget module
Here's the current set of plugins. Has anyone else reported anything similar? Or am I a snowflake ❄️ here? 😄
jupyter labextension list
$ jupyter labextension list @jupyter-widgets/jupyterlab-manager v1.1.0 enabled OK @jupyter-widgets/jupyterlab-sidecar v0.4.0 enabled OK @jupyterlab/geojson-extension v1.0.0 enabled OK @jupyterlab/git v0.9.0 enabled OK @jupyterlab/shortcutui v0.4.0 enabled OK jupyter-leaflet v0.12.6 enabled OK nbdime-jupyterlab v1.0.0 enabled OK
I'm configuring a JupyterLab (1.2.5) Docker environment, and I'm having a hard time getting ipyleaflet (0.12.3) to work consistently. When I create a simplified conda environment on my laptop with just JupyterLab,
@jupyter-widgets/jupyterlab-manager
andjupyter-leaflet
, things work fine, but when I add in other libraries and plugins and deploy via a Docker image,ipyleaflet
stops displaying maps, usually stuck on "Loading widget..." or "Error displaying widget: model not found" showing up in the notebook cell output, and the following in the browser (Chrome) console:jupyter.extensions.jupyter-leaflet failed to activate
``` Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead. Error at A (http://localhost:8888/static/lab/vendors~main.8429b74936d96d40265a.js:1:418775) at Function.D.extend (http://localhost:8888/static/lab/vendors~main.8429b74936d96d40265a.js:1:417777) at Object.OTXi (http://localhost:8888/static/lab/vendors~main.8429b74936d96d40265a.js:1:2116586) at n (http://localhost:8888/static/lab/main.54def8d69479e21e7b9a.js:1:875) at Object.mGYY (http://localhost:8888/static/lab/vendors~main.8429b74936d96d40265a.js:1:3855130) at n (http://localhost:8888/static/lab/main.54def8d69479e21e7b9a.js:1:875) at Module.MIrW (http://localhost:8888/static/lab/vendors~main.8429b74936d96d40265a.js:1:1972447) at n (http://localhost:8888/static/lab/main.54def8d69479e21e7b9a.js:1:875) at Object.O3wJ (http://localhost:8888/static/lab/vendors~main.8429b74936d96d40265a.js:1:2106302) at n (http://localhost:8888/static/lab/main.54def8d69479e21e7b9a.js:1:875) A @ leaflet-src.js:400 ... index.js:267 Plugin 'jupyter.extensions.jupyter-leaflet' failed to activate. ... Error: No provider for: jupyter.extensions.jupyterWidgetRegistry. at f.e.resolveRequiredService (index.js:182) at index.js:140 at Array.map ((Note: other ipywidget components (buttons, sliders, etc.) work fine.)
To make matters more frustrating, if I force reinstall
@jupyter-widgets/jupyterlab-manager
andjupyter-leaflet
from the JupyterLab terminal, hard reset the browser, and rerun the cells, sometimes the maps will show up. But not every time. :-/I'm assuming that there's a version conflict with another library causing all this, but after a week of chopping the environment up I'm still no further along, and running out of ideas.
Any tips on additional things to try would be appreciated. Maybe a pointer to what role
jupyter.extensions.jupyterWidgetRegistry
plays and why it wouldn't be found by the notebook plugin.Jupyter Conda Environment
jupyter labextension list