You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two dash apps (dash1, dash2) which both have a page called home. These each run on their own flask app, connected by a MiddlewareDispatcher (see test app). I expect for both these home pages to be served on /dash1/home & /dash2/home. When I try this though I get an error:
Exception: modules ['dashboards.dash1.pages.home', 'dashboards.dash2.pages.home'] have duplicate paths
When I check the page register, both dashboards have the same relative_path (see below). I believe this is because the page register is not tied to an object it is universal to all dash apps. For the full page registry, see further down.
module dashboards.dash1.pages.home
path /home
relative_path /dash1/home <---- SAME VALUES
module dashboards.dash2.pages.home
path /home
relative_path /dash1/home <---- SAME VALUES
If the page registry must be universal to all dash apps, I would expect the path to be prepended by url_base_pathname to avoid pathname collisions
Unfortunately patterns involving running two Dash instances within the same Python process are no longer supported by Dash. This is because there's a few different bits of global state that Dash uses to track things like callbacks defined with dash.callback (as opposed to app.callback ) and, as you've bumped into, state used by the Pages feature. These have been introduced over time starting some versions of Dash ago.
Here's a post in another repo where I took a stab at identifying all the global state that you could run afoul of trying to run multiple Dash instances in the one process. if you're careful, you could get some use cases to work by avoiding features that make use of them, but in general this is going to be risky, so might be better to fall back to another way of what you're trying to achieve.
Library Versions
Describe the bug / Expected Behaviour
See minimal test app setup below for test example
I have two dash apps (dash1, dash2) which both have a page called home. These each run on their own flask app, connected by a MiddlewareDispatcher (see test app). I expect for both these home pages to be served on /dash1/home & /dash2/home. When I try this though I get an error:
Exception: modules ['dashboards.dash1.pages.home', 'dashboards.dash2.pages.home'] have duplicate paths
When I check the page register, both dashboards have the same relative_path (see below). I believe this is because the page register is not tied to an object it is universal to all dash apps. For the full page registry, see further down.
If the page registry must be universal to all dash apps, I would expect the path to be prepended by
url_base_pathname
to avoid pathname collisionsExpected
Thank you!!
Minimal test app setup
app.py
dash1/_init_.py
dash1/pages/home.py
dash2/_init_.py
dash2/pages/home.py
Page Register
The text was updated successfully, but these errors were encountered: