When I create a JupyterLab extension that has a server component and launch it in mybinder.org, I see the error, “The jupyterlab_ext server extension appears to be missing.” in the console. jupyterlab_ext
is the name of this test extension.
This is a summary of the actions that I take in creating the extension and pushing it to Github.
conda create -n jupyterlab-ext --override-channels --strict-channel-priority -c conda-forge -c anaconda jupyterlab=3 cookiecutter nodejs jupyter-packaging git
conda activate jupyterlab-ext
cookiecutter https://github.com/jupyterlab/extension-cookiecutter-ts
cd jupyterlab_ext
git init
git add .
git commit -m 'first commit'
git branch -M main
git remote add origin git@github.com:educational-technology-collective/jupyterlab-ext.git
git push -u origin main
pip install -ve .
jupyter labextension develop --overwrite .
jupyter server extension enable jupyterlab_ext
jlpm run build
git add .
git commit -m 'commit'
git push origin main
For reference, this is the resulting test repo: GitHub - educational-technology-collective/jupyterlab-ext
At this point I click the binder button in the README.md file. JupyterLab launches, however the cookiecutter request to the server fails.
When I open a terminal in Binder and run jupyter server extension list
I do not see the server extension listed.
Hence, I add the line _(sys.executable, "-m", "jupyter", "server", "extension", "enable", "jupyterlab_ext")
to ./binder/postBuild. And, I commit and push the repo to GitHub.
At this point I click the binder button in the README.md file. JupyterLab launches, however the cookiecutter request to the server fails.
When I open a terminal in Binder and run jupyter server extension list
I see the server extension listed:
jupyterlab_ext enabled
- Validating jupyterlab_ext...
jupyterlab_ext 0.1.0 OK
However, as I indicated, the request to the server extension that is made in the activate
function fails.
It appears that after adding the code to postBuild, the server extension is found, however, perhaps, there is something wrong with the path of the request - I’m not sure.
The same test extension runs as expected on my local machine i.e., the request to the server component works.
Can anyone assist with this? You can observe the phenomenon by launching the Binder from the repo that I posted. If I should create an Issue, can you tell me which repo I should make the Issue in?