mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-16 09:34:30 -04:00
Playground not working due to incorrect mimetype in index.js #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @parkerhancock on GitHub (Nov 17, 2023).
Originally assigned to: @eyurtsev on GitHub.
I can't get the playground to load when using langserve because the index.js file is served with the mimetype "text/plain" and thus my browser (Chrome/Brave/Firefox) refuse to run it. Here are the response headers as reported by Chrome DevTools:

So, there are two problems here:
On 2, the HTML source code for the playground endpoint looks like this:
And thus, when the page fails to load, because the try/catch block does nothing, no informative error message is returned.
@eyurtsev commented on GitHub (Nov 20, 2023):
Thanks for reporting @parkerhancock
@parkerhancock commented on GitHub (Nov 20, 2023):
No problem! Also, if it helps, this issue is present on Windows PC's, but not Mac's. The identical example works fine on OSX.
@eyurtsev commented on GitHub (Nov 27, 2023):
Source of issue is: https://bugs.python.org/issue43975
@eyurtsev commented on GitHub (Nov 27, 2023):
Seems that mitigation is: https://docs.python.org/3/library/mimetypes.html#mimetypes.init
@trannhatquy commented on GitHub (May 10, 2024):
@eyurtsev how to fix the langserve playground not found error. Thank you