I'm creating a larger app where I optionally want to display Ipywidgets/ IPyleaflet if a button is clicked. I can see that in order for ipyleaflet to get loaded on button click I need to "ipywidgets" when I run pn.extension. This is not mentioned in the reference guide https://panel.holoviz.org/reference/panes/IPyWidget.html#panes-gallery-ipywidget.

Solution
Replace pn.extension with pn.extension("ipywidgets") in the reference guide.
Additional Context
If I instantiate ipyleaflet as a part of serving the application ipyleaflet loads without problems.