@Zach wrote:
Hi all,
I’m running into an issue where setting
suppress_callback_exceptionsworks for ignoring callbacks with missingInputs, but not for callbacks with missingStates (I.e. you have a callback with all theInputs defined and rendered in the app layout, but one or moreStates isn’t rendered yet).I have a small example of this here:
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State # Configure app app = dash.Dash( __name__, meta_tags=[{'name': 'viewport', 'content': 'width=device_width'}] ) app.config.suppress_callback_exceptions = True # Layout app.layout = html.Div( [ # Comment this out to cause an "Error loading dependencies" error dcc.Store(id='some-store'), # Comment this whole button out along with the Store to fix # the dependencies error html.Button( "Do something", id='do-something' ), html.Div( html.H1("Did something!"), id='did-something-container', hidden=True ) ] ) # Callbacks @app.callback( Output('did-something-container', 'hidden'), [Input('do-something', 'n_clicks')], [State('some-store', 'data')] ) def update_header(clicks, data): if not clicks: return True else: return False if __name__ == "__main__": app.run_server(debug=True, dev_tools_silence_routes_logging=True)If you comment out the
dcc.Store, you get anError loading dependenciesmessage when you load the page. However, if you comment out both thedcc.Storeand thehtml.Button, everything loads just fine.Is this the expected behavior of
suppress_callback_exceptions? If so, is there any workaround for the situation I’m encountering?
Posts: 1
Participants: 1