jupyter-widgets / widget-cookiecutter

A cookiecutter template for creating a custom Jupyter widget project.
BSD 3-Clause "New" or "Revised" License
258 stars 72 forks source link

Support for Jupyter Lab 3 #79

Closed amirebrahimi closed 3 years ago

amirebrahimi commented 3 years ago

I tested out #72 with creating a new cookiecutter to test with Jupyter Lab 3. I get the follow error when attempting to instantiate HelloWorld() in a jupyter notebook:

Failed to load resource: the server responded with a status of 404 (Not Found) (tries to load http://localhost:8888/lab/extensions/pyQuirk/static/remoteEntry.38fd4edf763d3502e46e.js)

When Iook in my share/jupyter/labextensions/<package>/package.json file I see the following section under "jupyterlab"::

    "_build": {
      "load": "static\\remoteEntry.38fd4edf763d3502e46e.js",
      "extension": "./extension"
    }

TIA for anyone who knows how to solve this issue.

amirebrahimi commented 3 years ago

A bit more on this. I tried starting from scratch:

conda create -n jupyterlab3 python=3
conda install -c conda-forge jupyterlab3 nodejs
cookiecutter https://github.com/jupyter/widget-cookiecutter.git
cd hwjl3
pip install -e .
jupyter labextension install js

Then, I run jupyter lab create a notebook and try this code:

from hwjl3 import *
HelloWorld()

Error displaying widget...

This is the error I get in the console: :8888/static/lab/jlab_core.8356d3a981e7604d0b5b.js:92586 Plugin 'hwjl3' failed to activate.

martinRenou commented 3 years ago

This should work for JupyterLab 3 now