[Bug] Fix path to built-in Vizro assets #358
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There was a subtle bug where we were using
routes_pathname_prefix
somewhere we should have usedrequests_pathname_prefix
. What this meant was that in some deployments our built-in Vizro js and css would not be found.requests_pathname_prefix
is "is a local URL prefix for file requests. Must end withroutes_pathname_prefix
" (from Dash docs). "the prefix for the AJAX calls that originate from the client (the web browser)" (from comment in Dash source code). This is what's used when injecting flask server into Dash as in Host on a route of existing Flask approutes_pathname_prefix
is "a local URL prefix for JSON requests. Must start and end with'/'
" (from Dash docs). "the prefix for the API routes on the backend (this flask server)" (from comment in Dash source code). This is what's used when mounting Dash onto a server using middleware (could be WSGI like flask or ASGI like FastAPI that usesWSGIMiddleware
) as inDispatcherMiddleware
url_base_pathname = x
is equivalent to setting bothrequests_pathname_prefix = x
androutes_pathname_prefix = x
Previously things worked ok when
requests_pathname_prefix == routes_pathname_prefix
but not otherwise. Now it works ok - tested on:Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":