Panel output is not persisting in VS Code

Hey all,

Has anyone encountered/found a fix for Panel output not persisting in VS Code between saves?
I encountered this problem while I was working on publishing a blog in Quarto, and debugging it led me to this Panel bug in VS Code.
This does not occur when using JuypterLab, where the saves do persist the outputs

In VS Code, sometimes I simply see a white line, other times just BokehModel(...), and yet other times, something like

Could not render content for 'application/vnd.jupyter.widget-view+json'

Here’s an example of what I see prior to saving and reopening, and what I see afterwards. I’ve also included a Bokeh plot in the mix for debugging, and that remains persistent in the output between saves and reloads:




jupyter_bokeh == 4.0.1
panel == 1.4.1
vscode == 1.86.2
notebook == 7.1.2
bokeh == 3.4.0

I sometimes experience that too.

Sometimes, it’s just loading, after a while it pops up.

Other times, I clear all output, save, close the notebook, and re-open
(click clear, ctrl+s, ctrl+w, ctrl+shift+T)

If all doesn’t work, I use

Or if it’s HoloViews, I do

Perhaps raise a GitHub issue to have it potentially fixed for everyone :smiley:

Wish that worked. No issue with running the cells initially, just after the fact, the output disappears.
I also just tried IPython.display, which yielded the same result.

Will try and raise the issue in GitHub - microsoft/vscode-jupyter: VS Code Jupyter extension

On second thought, raised issue in Panel repo instead