ERROR in app: Exception on /_dash-update-component

I believe I am facing a similar issue to

Basically, it seems like I have an “old” client making requests against the new application. Is there any way to deal with this without asking folks to refresh their browsers?

The application is working as expected locally inside the same docker container.

The browser needs to be refreshed one way or another.

One idea I have is to have a callback that is consistent across all my application versions that once an hour checks the version number of my application. If the version number has increased it displays a warning to the user to refresh the web page, or it could even update the dcc.Link component to force the page to be refreshed.

But I haven’t implemented this yet. If I get a simple example working I’ll try and share the code somewhere if someone hasn’t already done something similar.

1 Like

That is an interesting idea. I’ll see if I can get something like that working.

Here’s what I did (worked locally anyway). I have a callback function,

    Output("smp-graph", "figure"), [Input("interval-component", "n_intervals")]
def update_smp_graph(_):
    return generate_smp_figure(labels)

The generate_smp_figure function

def generate_smp_figure(labels):
    d = {"layout":  cluster_plot_layout("SMP")}
    if version == "0.0.1":
        d["data"] = cluster_plot_traces(labels, to_display["smp"])
        d["data"] = refresh_your_page()
    return d

I started it with global version = "0.0.1" waited for it to update once (normal operation, which was fine). I changed the global version to "0.0.2" and restarted the server. When the client tried to update it triggered the refresh_your_page function. This seems okay.

1 Like

I updated my dash dependency from 0.20.0 to 0.40.0 and had to change the structure of the app a bit so this won’t fix my current problem, but it will be a nice solution for updates moving forward.