I have developed a simple Jupyter Server extension that I would like to deploy on TLJH. I set up a TLJH development environment in a Docker container and successfully installed the extension. If I run jupyter server extension list I get the following output:
demo_app enabled
- Validating demo_app...
demo_app OK
I know that Jupyter Server is currently not the default server back-end, so I followed the instructions mentioned here and here. However, when I login to my TLJH instance through the browser and try to access my extension, I get a 404 : Not Found error.
I looked through the logs and didn’t find much that would help me understand what went wrong. For instance, in the jupyterhub logs I only found the following:
I already did something quite similar with the old NotebookApp, which basically worked out of the box. I am puzzled what the problem could be here, and I would be grateful for hints where to start with the debugging. To be honest, I don’t even know how to check if I was successful in making Jupyter Server the default back-end …
Well, it turns out I had the extension’s handlers configured incorrectly. My server extension declared the handler for the main entry point like this:
Because class ExtensionApp adds the base URL to the enpoints by default, this resulted in an endpoint of the form /user/username/user/username/extension_url. I just had to change the handler declaration to:
Hello @ewidl I just came a across this post and despite I am not facing the same issue as you. I wanted to ask you a couple things:
How did you package the extension to be deployed in your TLJH instance? I have followed this instructions. I can get the lab extension installed and listed when executing jupyter labextension list however it doesn’t show up when executing jupyter serverextension list.
Have you found any particularity/singularity of packaging and deploying lab extensions that has a frontend and a server component to a TLJH instance?
Packing of JupyterLab extensions is indeed a bit tricky. This is mostly because you have not only to package the Python code, but also the TypeScript code (or its artifacts). Package jupyter_packaging provides several useful functions to do that, for instance install_npm …
However, I have not yet worked on an extension for JupyterLab 3.0, so there might be a few obstacles that I am unaware of. I am therefore cautious to give advice here. But I always found it very instructive to take a look at other extensions that are actively maintained, for instance jupyterlab-git (and especially the setup.py in this specific case).
It’s a bit confusing unfortunately, but try running jupyter server extension list (notice the space between server and extension). The subcommand you used above points to the classic notebook server extension list, not the new jupyter_server extension list.
You may need to enable your extension against the Jupyter Server using jupyter server extension enable <extension_name> (again, notice the space).