Hi,
I might have found a hack :
try:
fig = px.scatter(...)
except Exception:
fig = px.scatter(...) # Exact same line as previously
return fig
It works in for me in development, and I’ll try later in production.
The idea behind is that it works randomly at the first attempt but always works on the second (e.g. when refreshing the page). Here I don’t wait for a refresh and force the second attempt in the except
part.
On my trials to fix it, I also added prevent_initial_callback=True
to some of the @app.callback(...)
because callbacks producing plotly figures are called whenever a dcc.Store
data attribute changes. Thus I make sure that callbacks for plotting figures are not triggered before data is maid available.
Let me know if it’s working for you.