-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to open playground page when using add_routes() with FastAPI's APIRouter #578
Comments
Thanks! Will take a look on Monday. Which version of langserve are you on? |
Thanks for looking into it! I'm using 0.0.51 |
@StreetLamb I am unable to reproduce, would you be kind enough to help me create an MRE with the unit tests? |
Hi @eyurtsev, raised a PR to update the playground unit tests as requested. |
Hi, I am having the same issue on langserve version 0.1.1. Any news on this issue? |
I'm using APIRouter to separate my routes like so:
I am able to access
http://localhost /api/v1/chat/invoke
properly. Howeverhttp://localhost/api/v1/chat/playground
brings me to a blank page. I get the error:Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
On inspecting network, issue seems to be that the page is incorrectly fetching the playground assets from the base URL
http://localhost/playground/assets/index-dbc96538.js
instead ofhttp://localhost/api/v1/chat/playground/assets/index-dbc96538.js
.My workaround for now is to move all the prefixes into add_routes instead:
Ideally, it should be able to infer the correct path when working with prefixes.
The text was updated successfully, but these errors were encountered: