The `/static/notebook/js/mathjaxutils.js` is missing

Not sure is this a bug of jupyter notebook or a bug of nbextensions.

To Reproduce
Steps to reproduce the behavior:

the content of Dockerfile

# syntax=docker/dockerfile:experimental

FROM python:3.8-buster@sha256:6a25504ef508896ab6682c1696b53ea7a5247b45ca1466e708717ce675831c03

RUN sed -i "s/\\w\" /etc/apt/sources.list \
 && pip install -U pip -i \
 && pip config set global.index-url

RUN --mount=type=cache,target=/var/cache/apt \
    --mount=type=cache,target=/var/lib/apt \
    apt-get update \
 && apt-get install -yq --no-install-recommends \
        ca-certificates \
        libgeos-dev \
        wget \
        nodejs \
        npm \
        g++ \
        libzmq3-dev \
        gosu \
 && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN --mount=type=cache,target=/root/.cache/pip \
    pip install \
        jupyter==1.0.0 \
        jupyter_contrib_nbextensions \
 && jupyter contrib nbextension install --system

VOLUME [ "/workspace" ]
WORKDIR /workspace
COPY /usr/local/bin/

ENV NB_USER=jupyter NB_GROUP=jupyter NB_UID=1000 NB_GID=1000 NB_HOME=/workspace

CMD [ "jupyter", "notebook", "--ip="]

the content of

set -e
# Add group
groupadd -f -g $NB_GID $NB_GROUP
# Add user
useradd -u $NB_UID -g $NB_GID -d $NB_HOME -N $NB_USER


exec gosu $NB_UID "$@"

build and run:

DOCKER_BUILDKIT=1 docker build . -t jupyter
docker run -p 18888:8888 jupyter

then open the jupyter notebook in browser, and no nbextension option appears.
Look at devtools, and there is net::ERR_ABORTED 404 (Not Found) for /static/notebook/js/mathjaxutils.js.

Expected behavior
no 404 error.

Desktop (please complete the following information):

  • OS: jupyter service is in docker, Web Brower is in Windows10
  • Browser: appears in Both Chrome And Edge

Is there a way to fix this? It prevents me from using extension.


The Jupyter Notebook developers has moved the mathjaxutils.js file from static/notebook/js/mathjaxutils to static/base/js/mathjaxutils.js from this commit.

At the moment, you need to somehow change this line of code to make it load from the correct path.


An issue has been created to the repo.

1 Like

This should be fixed in notebook>=6.2.0, thanks to this PR: Add shim to mathjaxutils.js by kevin-bates · Pull Request #5934 · jupyter/notebook · GitHub

1 Like