# Notebook client just started dying with JavaScript error

**URL:** <https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273>\
**Category:** Notebook\
**Tags:** help-wanted\
**Created:** [September 5, 2023, 7:29pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273 "2023-09-05T19:29:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 5, 2023, 7:29pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/1 "2023-09-05T19:29:02Z")

</div>

I have an installer that builds a venv, installs `notebook`, and runs a notebook. It’s been working for weeks, and has brought the notebook up in the default browser.

Nothing is pinned yet, so I get whatever the ‘newest’ stuff is, when I rebuild the venv (which is always), because I’m testing the installer. Just this weekend, it stopped working. Notebook server starts up fine, serves a page, and it’s empty. Whereas I used to see a bunch of stuff in the JS console, now I just have an error.

Here’s what I’m seeing. Where it seems to be dying is in this call `o(958)`.

 ![02_58_38](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/d/de3d07b6c53b96e84d860d0434e61c281f045a26.jpeg)

Specifically, it dies when executing the line highlighted here:

(Sigh, I’m only allowed one image, see “Image 2” in the next post.)

With the following error:

(Image 3)

The JS interpreter quits right after that line of code.

I have tried _everything_ I can think of and/or find online for “notebook blank page” remediation and nothing has helped.

Is this a bug that was introduced recently? Or can anyone tell me what this particular call is trying to do , and/or why it is failing, and what in my environment might have changed to cause it?

---

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 5, 2023, 7:30pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/2 "2023-09-05T19:30:11Z")

</div>

Image 2:

 ![03_06_45](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/3/379c103cc9af0186d18968ad0a32d5321cd85aae.jpeg)

---

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 5, 2023, 7:30pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/3 "2023-09-05T19:30:48Z")

</div>

Image 3:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/6/67d1cb38f25f892cd64558eb5a866c365d47330e.png)

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [September 5, 2023, 7:47pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/4 "2023-09-05T19:47:37Z")

</div>

Thank you for reporting this. I would encourage you to open an issue on [Issues · jupyter/notebook · GitHub](https://github.com/jupyter/notebook/issues) with more details (browser and version, operatying system, exact version of notebook package) - this will help to understand the issue better.

---

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 5, 2023, 7:52pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/5 "2023-09-05T19:52:27Z")

</div>

Kewl, thanks, will do.

---

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 5, 2023, 9:01pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/6 "2023-09-05T21:01:21Z")

</div>

Still writing the github ticket, but new info:

So, the notebook is blank with `pip install notebook` which was installing 7.0.3. `pip install --force-reinstall "notebook==7.0.0"` didn’t help.

`pip install --force-reinstall -v "notebook>=6,<7"` is picking up 6.5.5, and I get a notebook in the browser.

Pretty dang sure I was using 7.0.x ≪_avant la débâcle_≫, but the `notebook` module has a crapload of dependencies, so maybe one of those has changed or something?

In any case, it’s a workaround for the moment.

---

<div class="post-metadata">

**Author:** ![defjaf](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/defjaf/32/10536_2.png) [@defjaf](https://discourse.jupyter.org/u/defjaf)\
**Post date:** [September 5, 2023, 9:11pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/7 "2023-09-05T21:11:34Z")

</div>

You seem to be on macOS. Perhaps related to these linked bugs?

> <https://github.com/jupyter/notebook/issues/6974>
>
> I am getting an error when launching jupyter.
> I uninstalled everything includin…g python (with brew) and still not solving the issue.
>  
> The folder \`/opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/\` 
> doesn't contain the \`jupyter\` folder. 
> 
> \`\`\`
> \[I 2023-07-20 23:41:40.032 ServerApp\] Package notebook took 0.0000s to import
> \[I 2023-07-20 23:41:40.034 ServerApp\] notebook | extension was successfully linked.
> \[I 2023-07-20 23:41:40.077 ServerApp\] notebook | extension was successfully loaded.
> \[I 2023-07-20 23:41:40.078 ServerApp\] Serving notebooks from local directory: /Users/\<\>/dev
> \[I 2023-07-20 23:41:40.078 ServerApp\] Jupyter Server 2.7.0 is running at:
> \[I 2023-07-20 23:41:40.078 ServerApp\] http://localhost:8888/tree?token=f9035f29fdb2ce27b7c4664295b20b6ad5aa3315937fecc5
> \[I 2023-07-20 23:41:40.078 ServerApp\] http://127.0.0.1:8888/tree?token=f9035f29fdb2ce27b7c4664295b20b6ad5aa3315937fecc5
> \[I 2023-07-20 23:41:40.078 ServerApp\] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
> \[C 2023-07-20 23:41:40.086 ServerApp\] 
>     
> To access the server, open this file in a browser:
> file:///Users/\<\>/Library/Jupyter/runtime/jpserver-6423-open.html
> Or copy and paste one of these URLs:
> http://localhost:8888/tree?token=f9035f29fdb2ce27b7c4664295b20b6ad5aa3315937fecc5
> http://127.0.0.1:8888/tree?token=f9035f29fdb2ce27b7c4664295b20b6ad5aa3315937fecc5
> 0.00s - Debugger warning: It seems that frozen modules are being used, which may
> 0.00s - make the debugger miss breakpoints. Please pass -Xfrozen\_modules=off
> 0.00s - to python to disable frozen modules.
> 0.00s - Note: Debugging will proceed. Set PYDEVD\_DISABLE\_FILE\_VALIDATION=1 to disable this validation.
> \[W 2023-07-20 23:41:42.105 JupyterNotebookApp\] Missing or misshapen translation settings schema:
> HTTP 404: Not Found (Schema not found: /opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/jupyter/lab/schemas/@jupyterlab/translation-extension/plugin.json)
> \[W 2023-07-20 23:41:42.106 JupyterNotebookApp\] Settings directory does not exist at /opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/jupyter/lab/schemas
> \[W 2023-07-20 23:41:42.146 JupyterNotebookApp\] Missing or misshapen translation settings schema:
> HTTP 404: Not Found (Schema not found: /opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/jupyter/lab/schemas/@jupyterlab/translation-extension/plugin.json)
> \[W 2023-07-20 23:41:42.146 ServerApp\] 404 GET /lab/api/settings/@jupyter-notebook/application-extension:shell?1689910902143 (::1): Schema not found: /opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json
> \[W 2023-07-20 23:41:42.146 JupyterNotebookApp\] wrote error: 'Schema not found: /opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json'
> Traceback (most recent call last):
> File "/opt/homebrew/lib/python3.11/site-packages/tornado/web.py", line 1784, in \_execute
> result = method(\*self.path\_args, \*\*self.path\_kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/opt/homebrew/lib/python3.11/site-packages/tornado/web.py", line 3290, in wrapper
> return method(self, \*args, \*\*kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/opt/homebrew/lib/python3.11/site-packages/jupyterlab\_server/settings\_handler.py", line 48, in get
> result, warnings = get\_settings(
> ^^^^^^^^^^^^^
> File "/opt/homebrew/lib/python3.11/site-packages/jupyterlab\_server/settings\_utils.py", line 370, in get\_settings
> schema, version = \_get\_schema(schemas\_dir, schema\_name, overrides, labextensions\_path)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/opt/homebrew/lib/python3.11/site-packages/jupyterlab\_server/settings\_utils.py", line 47, in \_get\_schema
> raise web.HTTPError(404, notfound\_error % path)
> tornado.web.HTTPError: HTTP 404: Not Found (Schema not found: /opt/homebrew/Cellar/python@3.11/3.11.4\_1/Frameworks/Python.framework/Versions/3.11/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json)
> \[W 2023-07-20 23:41:42.149 JupyterNotebookApp\] 404 GET /lab/api/settings/@jupyter-notebook/application-extension:shell?1689910902143 (7f80a9c368014c73b2be2492888a488c@::1) 3.94ms referer=http://localhost:8888/tree
> \`\`\`
> 
> Here the lib I am ussing:
> 
> \`\`\`
> ipykernel==6.24.0
> notebook==7.0.0
> notebook\_shim==0.2.3
> Python 3.11.4
> \`\`\`
> 
> Jupyter lab would work using 
> \`jupyter lab --app-dir /opt/homebrew/share/jupyter/lab\`
> 
> How do I change the path to run \`jupyter notebook\`?
> 
> 
> Thank you

> <https://github.com/jupyterlab/jupyterlab/issues/14890>
>
> \## Description
> 
> On \[homebrew python installations on macOS\](https://docs.brew.…sh/Homebrew-and-Python), with \`pip\` installation of packages: 
> \* "Open in..." menu, extension manager and extension UI all don't show up correctly.
> \* Seems to be related to locations of config files.
> 
> There are also related bugs specific to:
> \* \[notebook 7 — see this issue\](https://github.com/jupyter/notebook/issues/6974) (This has a \[full list of all related symptoms\](https://github.com/jupyter/notebook/issues/6974#issuecomment-1659117884).)
> \* \[nbclassic — see this issue\](https://github.com/jupyter/nbclassic/issues/255)
> 
> Basically, with homebrew python, \`jupyter --paths\` \_should\_ have:
> \* \`/opt/homebrew/etc/jupyter\`in "config" and 
> \* \`/opt/homebrew/share/jupyter\` in "data" 
> 
> This can be done by hand with \`JUPYTER\_PATH=/opt/homebrew/share/jupyter JUPYTER\_CONFIG\_PATH=/opt/homebrew/etc/jupyter\`.
> (or homebrew should somehow populate the default directories with the contents that it places in those locations).
> 
> Note also that the config homebrew directories that \_does\_ appear in \`jupyter --paths\` — \`/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/etc/jupyter\` — does not exist. The data dir \`.../share/jupyter\` exists (perhaps only after \`jupyter build\`?) but is different from \`/opt/homebrew/share/jupyter\`.
> 
> (I don't know if this is unique to macOS — there is also linux homebrew — or indeed if this could be a broader issue, but I've only seen it for this one case.)
> 
> \## Reproduce
> 
> In the "base" homebrew python environment (i.e., no venv, and also not the system python), with \`jupyter lab\`:
> \* the "Open in..." menu does not appear
> \* the "Installed" extension list is empty and, for example, there is no sidebar entry for ipyparallel even when installed: 
> 
> \<img width="359" alt="Screenshot 2023-07-29 at 16 49 09" src="https://github.com/jupyter/notebook/assets/799252/e5946bdf-ccc9-43e5-ad35-45072f4cb949"\>
> 
> The problem disappears with \`JUPYTER\_PATH=/opt/homebrew/share/jupyter JUPYTER\_CONFIG\_PATH=/opt/homebrew/etc/jupyter\`.
> 
> \## Expected behavior
> 
> When run with those variables set, or in a venv, these issues go away. In particular:
> 
> \<img width="365" alt="Screenshot 2023-07-29 at 16 50 45" src="https://github.com/jupyter/notebook/assets/799252/f319d896-c03c-4500-9d0e-00c4f11114b1"\>
> 
> \## Context
> 
> \- Operating System and version: macOS 13.5 with homebrew.
> \- Browser and version: Safari 16.6
> \- JupyterLab version: 4.0.3
> \- Notebook version: 7
> 
> \<details\>\<summary\>\`jupyter --paths\`\</summary\>
> \<pre\>
> config:
> /Users/jaffe/.jupyter
> /Users/jaffe/Library/Python/3.11/etc/jupyter
> /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/etc/jupyter
> /usr/local/etc/jupyter
> /etc/jupyter
> data:
> /Users/jaffe/Library/Jupyter
> /Users/jaffe/Library/Python/3.11/share/jupyter
> /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/share/jupyter
> /usr/local/share/jupyter
> /usr/share/jupyter
> runtime:
> /Users/jaffe/Library/Jupyter/runtime
> \</pre\>
> \</details\>

Does the following help at all?

```auto
JUPYTER_PATH=/opt/homebrew/share/jupyter JUPYTER_CONFIG_PATH=/opt/homebrew/etc/jupyter jupyter notebook

```

---

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 5, 2023, 9:22pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/8 "2023-09-05T21:22:15Z")

</div>

Yes, MacOS. Still need to write all the OS/browser/Python details in the other ticket, then I’ll crosspost.

Thank you for these. That last one looks promising.

I have `JUPYTER_CONFIG_PATH` set in the script that builds and sources the venv, to the venv path, but not `JUPYTER_PATH`. Could be another source of issues.

Will advise.

---

<div class="post-metadata">

**Author:** ![defjaf](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/defjaf/32/10536_2.png) [@defjaf](https://discourse.jupyter.org/u/defjaf)\
**Post date:** [September 5, 2023, 9:24pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/9 "2023-09-05T21:24:46Z")

</div>

… and perhaps see [[Do Not Merge] Troubleshooting the Homebrew installs by RRosio · Pull Request #7006 · jupyter/notebook · GitHub](https://github.com/jupyter/notebook/pull/7006) for some data points about the interaction of this bug with `venv`s.

---

<div class="post-metadata">

**Author:** ![d00g](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@d00g](https://discourse.jupyter.org/u/d00g)\
**Post date:** [September 8, 2023, 8:36pm UTC](https://discourse.jupyter.org/t/notebook-client-just-started-dying-with-javascript-error/21273/10 "2023-09-08T20:36:31Z")

</div>

Now that (this leg of) the Death March is over, I have some time to try and make a minimally reproducible example.

```auto
> bash -i
bash-3.2$ more JupyterBug.bash
which bash
uname -a
cd ~
pwd
mkdir JupyterTest
cd JupyterTest
ls -las
which python3.10
python3.10 -V
python3.10 -m venv notebook_venv
source notebook_venv/bin/activate
pip install --upgrade pip setuptools
pip list
pip install --force-reinstall "notebook==7.0.3"
pip list
/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' /Applications/Safari.app/Contents/Info.plist
open -a /Applications/Safari.app/Contents/MacOS/Safari 2> /dev/null &
jupyter-notebook & # notebook comes up with blank page
sleep 20
jupyter notebook stop

```

I was able to reproduce the failure with this. Clearing the browser cache ended up letting it work, and I got a notebook page.

I was AFK much of last Friday and Saturday and I ran into this issue on Sunday, I believe. 7.0.3 dropped on… Thursday?

Perhaps something in browser cache that 7.0.2 was fine with but 7.0.3 wasn’t?

I can post my output for the script if this doesn’t explain, but I don’t know that it’s going to tell anyone anything about what was in cache…
