Closed bigmike36c closed 2 years ago
the error seems to be coming from the validation layout which doesn't check to see whether the app.layout is a function https://github.com/plotly/dash-labs/blob/fa90c6f9dd1445cfed6ca799ad3965a6b5ffd910/dash_labs/plugins/pages.py#L378
changing that line to [app.layout() if callable(app.layout) else app.layout]
resolves the issue for me
Thanks @michaelbabyn !! Would you like to do the PR for your solution, or would you prefer I add it to the one I have open now?
Sorry for the late response, @AnnMarieW please add it to yours since it's probably simpler that way
I'm having an issue using dynamic layouts with dash lab's
pages/
plugin. I'm trying to use a dynamic layout to fetch new data when the user refreshes the page as detailed in the docs. However, I keep receiving the error message shown below.The only way I can get around this error is setting app.layout equal to the function call, "serve_layout()", instead of the function instance, "serve_layout". I don't understand why my "fix" worked, and from what I can tell in my testing, the layout is no longer dynamic and does not respond to changes in the data source when I refresh the page. I've included a simple example that just requires an empty
pages/
directory in addition to the code below.