Thanks so much for this explanation! I will try it.
I also get some similar errors while clicking on the side bar on my UI with the updated dash version:
dash._grouping.SchemaLengthValidationError: Schema: [<Output `sidebar.children`>, <Output `page-content.children`>]
Path: ()
Expected length: 2
Received value of length 3:
[<function sidebar_reinv_mix at 0x7f7e4a8a0c10>, Jumbotron([H1(children='404: Not found', className='text-danger'), Hr(None), P('The pathname /upload was not recognised...')]), '{"py/object": "src.tracker_store.TrackerStore", "_current_step": "start", "_all_log_str_dict": {"start": "Click the icon to upload your mix files", "check": "check the mix files\' quality", "upload": "upload the files to PolyPaths", "calculate": "calculate the base analytics via PolyPaths", "complete": "ready to go"}, "_all_log_p_lst": [["Click the icon to upload your mix files"], ["check the mix files\' quality"], ["upload the files to PolyPaths"], ["calculate the base analytics via PolyPaths"], ["ready to go"]], "_poly_params": {}, "_hist_pipeline_log": []}']
The code that defines the side bars are as follows:
@app.callback(
[
Output("sidebar", "children"),
Output("page-content", "children"),
],
[
Input("url", "pathname"),
],
[
State('session-id', 'data'),
]
)
def render_page_content(pathname, session_id):
tracker_store = SESSION_MANAGER.get_tracker_store(session_id)
reinv_mix_store = SESSION_MANAGER.get_reinv_mix_store(session_id)
pricing_date = tracker_store.pricing_date
if pathname in [app_root+"/", app_root+"/snapshot"]:
return [sidebar_reinv_mix('snapshot', pricing_date), page_snapshot()]
elif pathname == app_root+"/upload":
return [sidebar_reinv_mix('upload', pricing_date), page_upload(tracker_store, reinv_mix_store)]
elif pathname == app_root+"/analytics":
return [sidebar_reinv_mix('analytics', pricing_date), page_analytics(reinv_mix_store)]
elif pathname == app_root+"/forecast":
return [sidebar_reinv_mix('forecast', pricing_date), make_page_forecast(reinv_mix_store)]
# If the user tries to reach a different page, return a 404 message
return [
sidebar_reinv_mix,
dbc.Jumbotron(
[
html.H1("404: Not found", className="text-danger"),
html.Hr(),
html.P(f"The pathname {pathname} was not recognised..."),
]
),
tracker_store.to_json(),
]
Could you help me understand why it is the case? Is this error caused by dash version upgrade as well?