Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name collision between geojson and json? #53

Closed
RobinL opened this issue Oct 22, 2017 · 4 comments
Closed

Name collision between geojson and json? #53

RobinL opened this issue Oct 22, 2017 · 4 comments

Comments

@RobinL
Copy link

RobinL commented Oct 22, 2017

Building the following Dockerfile

FROM jupyter/datascience-notebook

# See https://github.com/jupyterlab/jupyter-renderers
# Note there seems to be a bug that means you need to install json before geojson
RUN jupyter labextension install @jupyterlab/json-extension
RUN jupyter labextension install @jupyterlab/geojson-extension

docker build -t jldebug .

and then running:

 docker run -d -p 8888:8888 jldebug start.sh jupyter lab --NotebookApp.token=''

causes the browser to hang.

Looking in Devtools, we see that mimeExtensions contains:

{MIME_TYPE: "application/pdf", PDF_CLASS: "jp-PDFViewer", PDF_CONTAINER_CLASS: "jp-PDFContainer", rendererFactory: {…}, RenderedPDF: ƒ, …}

{VEGA_MIME_TYPE: "application/vnd.vega.v2+json", VEGALITE_MIME_TYPE: "application/vnd.vegalite.v1+json", rendererFactory: {…}, default: {…}, RenderedVega: ƒ, …}

{MIME_TYPE: "application/json", rendererFactory: {…}, default: Array(1), __esModule: true, RenderedJSON: ƒ}

{MIME_TYPE: "application/geo+json", rendererFactory: {…}, default: Array(1), __esModule: true, RenderedGeoJSON: ƒ}

```

But when the mimeExtensions are turned into plugins in the main JupyterLab application class we get:

```

{id: "jupyter.services.mimerenderer-PDF", requires: Array(1), autoStart: true, activate: ƒ}

{id: "jupyter.services.mimerenderer-vega", requires: Array(1), autoStart: true, activate: ƒ}

{id: "jupyter.services.mimerenderer-undefined", requires: Array(1), autoStart: true, activate: ƒ}

{id: "jupyter.services.mimerenderer-undefined", requires: Array(1), autoStart: true, activate: ƒ}

```

This causes 
```
index.js:89 Uncaught Error: Plugin 'jupyter.services.mimerenderer-undefined' is already registered.
```

Everything seems to be fine so long as only one of these plugins is included in the dockerfile
@RobinL
Copy link
Author

RobinL commented Oct 22, 2017

A little more investigation seems to identify inconsistency between implementation in various plugins -
e.g.:
https://github.com/altair-viz/jupyterlab_voyager/blob/1a9a23cbc42b07905f92371f5f398293c1488ffa/src/index.ts#L68

causes this to appear with plugin id jupyter.services.mimerendererer-I don't know what this does

whereas

id: '@jupyterlab/plotly-extension:factory',

has no name, and appears with plugin id jupyter.services.mimerenderer-undefined

@gnestor
Copy link
Collaborator

gnestor commented Nov 3, 2017

@blink1073 Does this make sense to you?

@blink1073
Copy link
Member

This was fixed by jupyterlab/jupyterlab#3148, by running pip install jupyterlab==0.28.12, it now properly detects compatibility of mime renderer extensions.

@gnestor
Copy link
Collaborator

gnestor commented Nov 4, 2017

Feel free to re-open if upgrading to jupyterlab 0.28.12 doesn't not resolve this for you.

@gnestor gnestor closed this as completed Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants