After Update - Markdown cells are not rendered anymore

Hi,

I installed a jupyterhub server quite some time ago. Today I updated both the server and Python packages.Now the rendered markdown cells are not shown anymore, the souce cod is there, when I click on a cell, but evaluating the cell yeilds nothing.

The code “forschung.info()” also returns Markdown and results in:

Javascript Error: Cannot read properties of undefined (reading ‘theme’)

What could be the source of the problem? Or a solution? Or how could I find that out?

Any hints are highly appreciated!
Thank you very much!

Marc

1 Like

I’m not sure how forschung works or what it is, but this is likely an issue that this package doesn’t work with the version of JupyterLab you are using. Since it’s publishing Javascript to evaluate code in the browser, that is sensitive to versions of the frontend UI (JupyterLab).

Make sure both are up to date, and if it still doesn’t work, report the issue to forschung author(s). If that’s you, you’ll need to check with the javascript code you are publishing and the context in which it executes.

1 Like

Hi,

thank you for your fast reply.

info() simply returns a help text in Markdown form

def info():
    infotext = '''
### Es stehen folgende Funktionen zur Verfügung:
| Funktion           | Beschreibung |
|:-------------------|:-------------|
|info()  | Diese Information zur Forschungsdatenbank |
|sql(sql_statement, index_column = None) | Ausführen des sql statements sql_statement...  |
|tabellen() | Es wird eine Liste aller in der Datenbank zur Verfügung stehenden Tabellen zurückgeliefert. Es steht eine Beschreibung zur Verfügung.|
    '''
    display(Markdown(infotext))

but all Markdown cells are not rendered!
If I double click on the “not visible” cell, the Markdown source is shown…

partially done here:

The browser console shows tons of errors like:

jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1  Failed to render TypeError: Cannot read properties of undefined (reading 'theme')
    at get baseMarkdownItOptions (999.cd895bd57407720ae82f.js?v=cd895bd57407720ae82f:1:4512)
    at p.getOptions (999.cd895bd57407720ae82f.js?v=cd895bd57407720ae82f:1:4112)
    at p.getMarkdownIt (999.cd895bd57407720ae82f.js?v=cd895bd57407720ae82f:1:3652)
    at g.render (999.cd895bd57407720ae82f.js?v=cd895bd57407720ae82f:1:674)
    at g.renderModel (jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1:1286324)
    at Ke._updateRenderedInput (jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1:267535)
    at Ke._handleRendered (jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1:267214)
    at Ke.onUpdateRequest (jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1:266838)
    at Ke.processMessage (jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1:1781107)
    at b (jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1:1753611)
(anonym) @ jlab_core.23e8a6b191d1fa15c1b7.js?v=23e8a6b191d1fa15c1b7:1
336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1  Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early
_loadFromKernel @ 336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1

So ipywidgets seems to be causing the issue, right?

Inspecting this further, there seems to be a mismatch with various libraries

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jupyter-server-ydoc 0.8.0 requires jupyter-ydoc<0.4.0,>=0.2.0, but you have jupyter-ydoc 2.0.1 which is incompatible.
jupyter-server-ydoc 0.8.0 requires ypy-websocket<0.9.0,>=0.8.2, but you have ypy-websocket 0.12.4 which is incompatible.
jupyterlab-markup 2.0.0 requires jupyterlab==3.*,>=3.0, but you have jupyterlab 4.1.5 which is incompatible.

I tried to resolve this, but getting further errors with the dependency :cold_face:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
fastapi 0.110.0 requires starlette<0.37.0,>=0.36.3, but you have starlette 0.37.2 which is incompatible.
jupyterlab-markup 2.0.0 requires jupyterlab==3.*,>=3.0, but you have jupyterlab 4.1.5 which is incompatible.

I am not that experienced with the python environment, is there a means to resove this?

Thank you very much!

Marc

Ah, yes, it does appear to be a problem with the jupyterlab-markup package. Try uninstalling it. You don’t need jupyterlab-markup to view rendered markdown.

1 Like

Hi,

I removed it and

pip install --force-reinstall -v “starlette==0.36.3”
pip install --force-reinstall -v “ypy-websocket==0.8.4”
pip install --force-reinstall -v “jupyter-ydoc==0.3.4”
pip install --force-reinstall -v “jupyterlab==3.6.5”

working now. Thank you very much!

:+1: :+1: :+1:

Marc

1 Like

I’m seeing this exact problem but just using vanilla jupyter lab on Mac: Markup cells are visible when editing, disappear after pressing shift-return. No extra packages, no jupyter-markup, no forshung, no starlette, no jupyter-ydoc, no -y-anything.

$ pip uninstall jupyter-markup
WARNING: Skipping jupyter-markup as it is not installed.

$ pip list | grep jupyter
jupyter                   1.1.1
jupyter_client            8.6.3
jupyter_core              5.7.2
jupyter-events            0.10.0
jupyter-lsp               2.2.5
jupyter_server            2.14.2
jupyter_server_terminals  0.5.3
jupyterlab                4.3.0
jupyterlab_pygments       0.3.0
jupyterlab_server         2.27.3
jupyterlab_widgets        3.0.13

$ python --version
Python 3.11.9

Browsers affected are Brave, Chrome, Safari, on MacOS 15.1 (24B83).
On Windows/WSL/Ubuntu, I have no problem with the same .ipynb file.

No jupyter log errors, though I do see errors in the browser Javascript console:

jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1 Failed to render TypeError: Cannot read properties of undefined (reading 'theme')
    at resolveOptions (manager.ts:24:25)
    at Object.getRenderer (manager.ts:64:26)
    at RenderedMarkdown.render (widgets.ts:25:52)
    at RenderedMarkdown.renderModel (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:1334162)
    at Ke._updateRenderedInput (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:277163)
    at Ke._handleRendered (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:276842)
    at Ke.onUpdateRequest (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:276466)
    at Ke.processMessage (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:1842665)
    at b (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:1815168)
    at o (jlab_core.30ac71af4fabafb542d8.js?v=30ac71af4fabafb542d8:1:1813999)


Uncaught (in promise) TypeError: Cannot read properties of null (reading 'classList')
    at 568.5c851910383bda796a7a.js?v=5c851910383bda796a7a:1:8558
    at Array.forEach (<anonymous>)
    at L (568.5c851910383bda796a7a.js?v=5c851910383bda796a7a:1:8307)
    at 568.5c851910383bda796a7a.js?v=5c851910383bda796a7a:1:7511

This suggests a different fix is needed that what was listed above. Any suggestions?

So far, I’ve tried

  • Uninstalling & reinstalling anything jupyter-related: no effect.
  • Starting a completely fresh venv and only installing essentials, new, from scratch: no effect.
  • Trusting notebook. No effect.

Workaround: Open ipynb file in VS Code instead of jupyter lab :+1:

1 Like

Can you share the ipynb file, ideally opening an issue on JupyterLab GitHub?

1 Like

Sure. It happens for any and all ipynb files, include the one I just made that only contains “This is a Markdown cell”, which goes blank as soon as you press Shift-Enter. I’ll open an issue.

Here’s that minimum ipynb file:


Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif, svg)

:man_shrugging: ?
Opening Issue: All Markdown renders blank on Mac · Issue #16946 · jupyterlab/jupyterlab · GitHub

1 Like