3dmol / jupyterlab_3Dmol

JupyterLab extension for py3Dmol
19 stars 2 forks source link

TypeError: Cannot read property 'addFactory' of undefined #3

Closed kzinovjev closed 3 years ago

kzinovjev commented 3 years ago

Hello, With a fresh install of py3dmol/jupyterlab/jupyterlab_3Dmol, when tried to run a notebook, I got the following error:

TypeError: Cannot read property 'addFactory' of undefined
    at e.createNew (static/lab/1928.64e2a031d51156bae365.js?v=64e2a031d51156bae365:1)
    at static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2
    at c (static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2)
    at x._initializeWidget (static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2)
    at x.createWidget (static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2)
    at B._createOrOpenDocument (static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2)
    at B.open (static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2)
    at B.openOrReveal (static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2)
    at static/lab/jlab_core.6ab550837b77a81d7302.js?v=6ab550837b77a81d7302:2

Interestingly, in the console the plugin works well and I was able to fetch and visualize a structure.

Steps to reproduce with Docker Dockerfile:

FROM ubuntu:20.04
RUN apt-get update && apt-get -y update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python3.9 python3-pip python3-dev curl
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt -y install nodejs
RUN pip3 -q install pip --upgrade
RUN pip3 install jupyterlab py3dmol
RUN jupyter labextension install jupyterlab_3dmol

Then

$ docker build . --tag py3dmol
$ docker run --rm -t -i --publish 8888:8888 py3dmol jupyter lab --allow-root --no-browser --ip 0.0.0.0

What am I doing wrong? Thanks!

kzinovjev commented 3 years ago

Not installing jupyterlab_3dmol fixed the issue, so it seems that the recent jupyter lab supports py3Dmol out of the box.