voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.4k stars 501 forks source link

Voila prerender doesn't support markdown JupyterLab commands #1490

Open davidkan6666 opened 2 days ago

davidkan6666 commented 2 days ago

When using markdown cells containing JupyterLab commands, after being rendered by Voila, the required JavaScript libraries appear no longer available and result in errors like:

Command 'notebook:clear-all-cell-outputs' not registered Command 'help:about' not registered image

How to reproduce it?

  1. create a test notebook
  2. add the following code in Markdown cell: ` `
  3. run the cell in the notebook
  4. buttons work
  5. now open notebook with Voila Prerender
  6. click on any button will result in something like "Uncaught (in promise) Error: Command 'help:about' not registered" from developer tool (F12) Console.
Browser Output
2168.voila.js:1 Uncaught (in promise) Error: Command 'help:about' not registered.
    at d.execute (2168.voila.js:1:2959)
    at L._evtClick (1024.voila.js:1:35883)
    at L.handleEvent (1024.voila.js:1:35512)
2168.voila.js:1 Uncaught (in promise) Error: Command 'notebook:run-all-below' not registered.
    at d.execute (2168.voila.js:1:2959)
    at L._evtClick (1024.voila.js:1:35883)
    at L.handleEvent (1024.voila.js:1:35512)
2168.voila.js:1 Uncaught (in promise) Error: Command 'kernelmenu:interrupt' not registered.
    at d.execute (2168.voila.js:1:2959)
    at L._evtClick (1024.voila.js:1:35883)
    at L.handleEvent (1024.voila.js:1:35512)
2168.voila.js:1 Uncaught (in promise) Error: Command 'notebook:clear-all-cell-outputs' not registered.
    at d.execute (2168.voila.js:1:2959)
    at L._evtClick (1024.voila.js:1:35883)
    at L.handleEvent (1024.voila.js:1:35512)
Installed Labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v5.0.13 enabled OK (python, jupyterlab_widgets)
        @voila-dashboards/jupyterlab-preview v2.3.7 enabled OK (python, voila)
        @jupyter-notebook/lab-extension v7.1.3 enabled OK
fomightez commented 1 day ago

Discussion thread related to this issue is here on the Jupyter Discourse Forum.