Need urgent help - app.callback function doesn't get triggered at all. What should I do?

Hi @Stribor

From what you have posted here, it’s hard to understand exactly what you are trying to do. But generally, triggering a callback based on changes to the data in dcc.Store should work, but there are many reason why it may not.

Here are some typical bugs that cause a callback not to fire - especially in a multi-page app:

  1. Id’s are not unique. All ids must be unique in the entire app - not just unique per page of a multi-page app
  2. There is a typo in the id. For example in the layout an id is button-1 and in the callback it’s button_1
  3. All the components in the Outputs, Inputs and States are not in the layout. This can happen if one of the components is dynamically added to the layout from a different callback.
  4. There is an error on the page. Be sure to set debug=True so the dev tools show the errors and/or check the console for error messages.
if __name__ == "__main__":
    app.run_server(debug=True)

To debug, it’s helpful to try to isolate the error in a minimal working example. The first step could be making a single page app based on code you posted. Once that’s working, you could change it to a multi-page app. Then you would know the error is from the multi-page structure rather than the callback logic.

If you post a complete mwe, it will be easier for someone to give more specific guidance.

5 Likes