New notebook ok, new terminal blank

On a dedicated Debian 12 system, I’ve installed native jupterhub packages. In front of this system is an Apache reverse proxy front end (proxying jupyerhub and several other sites), configured according to jupyterhub docs.

The notebook component of jupterhub works fine, but the terminal component does not, displaying a blank screen. If I hit CTRL-U in the terminal tab in my browser, I see lots of html and javascript, so it’s loading something.

If I use the inspector in the browser, then the only obvious error is:

Uncaught ReferenceError: exports is not defined
<anonymous> index.js:1
[index.js:1](https://xxx-redacted-xxx/user/alexis/static/terminal/js/components/xterm.js-fit/index.js)
<anonymous> index.js:1

I’m not sure if that is relevant or not.

Version numbers are:

pansoti# dpkg -l | grep jupy | awk '{ print $2 " " $3 }'
jupyter-console 6.4.4-2
jupyter-core 4.12.0-1
jupyter-nbextension-jupyter-js-widgets 6.0.0-11
jupyter-notebook 6.4.12-2.2
jupyterhub 3.0.0+ds1-1
python3-jupyter-client 7.4.9-2
python3-jupyter-console 6.4.4-2
python3-jupyter-core 4.12.0-1
python3-jupyter-telemetry 0.1.0-4
python3-jupyterlab-pygments 0.2.2-3
python3-nbclient 0.7.2-1
pansoti# 

Python is 3.11.

Can anybody offer any advice please? If I should provide more logs, then please just tell me what. Many thanks!

This appears to be a problem in debian’s repackaging of javascript dependencies.

If you look at the file notebook specifies, the first line is a definition that ensures exports and require are defined. The file from head /usr/lib/python3/dist-packages/notebook/static/components/xterm.js-fit/index.js is missing the first line that defines exports, and starts with

Object.defineProperty(exports, "__esModule", { value: true });

which won’t work.

The file in /usr/share/javascript/xterm/addons/fit/fit.js does not match the file in dist/addons/fit/fit.js in the xterm.js release, which is what notebook needs.

I don’t expect this will be a problem for newer javascript frontends (JupyterLab or notebook 7), so switching to JuptyerLab as the UI may be the simplest fix if you must stick with the outdated debian packages.

1 Like

Many thanks @Minrk, that must have take a bit research! Much appreciated. I will switch to latest versions.

1 Like