Panel extension sometimes not loaded

Hey there,
In my application I used panel and ipywidgets (wrapper panel and contains ipywidgets.interactive).
In the beginning of my application I run pn.extension and than build the application:

def app():
   pn.extension()
   load_app()

Sometimes when I restart kernel and run the application all panel components not shown
(not shown that have to run pn.extension), rerun the application fixed the problem.

Can you please help me understand what is wrong?

Hi @bat-el

Welcome to the community.

Without more specific information we can only guess at the problem, cause and solution.

Please provide a minimum, reproducible code example and steps+screenshots or a small .gif video.

Thanks.

Hi @Marc ,
This is very flaky and I can’t catch it in video.
However, when it happened to me when i debugged the application.
When it happens, if opening Chrome Console can see a lot of errors.
The first one is error from jupyter: widget model not found.
Added screenshots of all the errors in console.

Hope it helps.
Thank you very much!

Please also provide a minimum reproducible code example. Without it it’s impossible to know if its a Panel, IPyWidgets, QGrid, AgGrid problem or something in your Jupyter installation.

Thanks.

Hey @Marc,
When I get weird part application, I get in console log errors from jupyter regarding - could not create a view for model

Given this simple application:

import panel as pn
pn.extension()
x=pn.widgets.Select(value=None, options=['test', 'tet'], name="")
pn.ipywidget(x)

When I run this application without line pn.extension() , I get same errors like I am getting with my own application.
My guess is that pn.extension is not loaded as excepted. Maybe it gets an exception or has an async function that were not finished before render.

Thanks