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'
{"model_id":"c3cc0de098a74132990e891d2c4435fe","version_major":2,"version_minor":0}

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:

Prior

After

Versions:

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
obj.show()

Or if it’s HoloViews, I do
pn.serve(obj)

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