Recommended ways of debugging JupyterLab

At one point I was able to open a .geojson file and get a map displayed with museums as in @jasongrout’s nice scipy2019-jupyterlab-tutorial. but perhaps after rebuilding my docker image I’m using as part of my JupyterHub deployment, I notice nothing when trying to open it by double-click or right clicking and choosing to open it as GeoJSON.

I want to debug this properly, but I have not debugged JupyterLab related issues before, so any recommendations on where to look for logs etc?

For this particular error I found a message in the inspector of the browser, but perhaps there is more logs somewhere as well?

Uncaught TypeError: Cannot read property 'DomEvent' of undefined
    at NewClass.addHooks (leaflet.draw.js:9)
    at NewClass.enable (leaflet-src.js:5722)
    at NewClass.addHandler (leaflet-src.js:3736)
    at NewClass.init (leaflet-src.js:385)
    at NewClass.proto.callInitHooks (leaflet-src.js:357)
    at NewClass.initialize (leaflet-src.js:3148)
    at new NewClass (leaflet-src.js:301)
    at Object.createMap [as map] (leaflet-src.js:4709)
    at new RenderedGeoJSON (index.js:66)
    at Object.createRenderer (index.js:145)
    at RenderMimeRegistry.createRenderer (registry.js:106)
    at MimeDocumentFactory.createNewWidget (mimedocument.js:185)
    at MimeDocumentFactory.createNew (default.js:327)
    at DocumentWidgetManager.createWidget (widgetmanager.js:62)
    at DocumentManager._createOrOpenDocument (manager.js:422)
    at (manager.js:249)

My guess is that this could be due to a version change of the leaflet JS library which got pulled in when you did a rebuild. Or it’s possible the JuptyerLab APIs changed since the geojson plugin was released, which could have broken it as well.

You could set a breakpoint here in the browser debugger and try to walk up the stack trace to try to see where the issue is originating from.

1 Like

@consideRatio I also came across (this?) or similar issue recently, in my case this was due to interaction with ipyleaflet extension. It is fixed now.

Thank you @Kirill888 excellent news!

I failed to follow here regarding my specific issue which was this: I also concluded one could not install both alongside at that point. Will make that issue point towards the resolution you linked! Nice!