Hello,
I am receiving the following callback error in a multi-page Plotly Dash application after generating a report:
A nonexistent object was used in an `Input` of a Dash callback.
The id of this object is `moe-generate-report-button`
and the property is `n_clicks`.
However, the list of component IDs in the current layout includes:
ma-generate-report-button
It does not include:
moe-generate-report-button
The relevant callback input is similar to:
Input("moe-generate-report-button", "n_clicks")
The component currently rendered on the page uses:
id="ma-generate-report-button"
This application contains multiple report pages, and some layouts are loaded dynamically. The error appears after I generate the report or navigate to the Machine Activity report page.
I would like to understand the recommended way to handle this situation:
- Should each report page have a separate callback using only the component IDs present in that page’s layout?
- If a callback needs components from different pages, should I define
app.validation_layoutcontaining all page layouts? - Is
suppress_callback_exceptions=Trueappropriate here, or does the callback still need to avoid referencing components that are absent from the currently rendered layout? - Could this error be caused by an incorrect or outdated component ID, since the callback uses the
moe-prefix while the current page uses thema-prefix?
My current configuration includes:
app = Dash(
__name__,
suppress_callback_exceptions=True
)
Environment:
Dash: 3.4.0
Python: 3.11.15
Operating system: Windows
I have attached a screenshot of the full browser error. Please let me know if a minimal reproducible example or the complete callback definition would help.