Playground not working due to incorrect mimetype in index.js #44

Closed
opened 2026-02-16 00:18:17 -05:00 by yindo · 5 comments
Owner

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:
image

So, there are two problems here:

  1. The index.js file is being served with an incorrect mimetype, causing the playground to fail, and
  2. When the playground fails, a blank page is returned.

On 2, the HTML source code for the playground endpoint looks like this:

<body>
 <div id="root"></div>
  <script>
    try {
      window.CONFIG_SCHEMA = . . .
      window.INPUT_SCHEMA = . . . 
    } catch (error) {
      // pass
    }
  </script>
</body>

And thus, when the page fails to load, because the try/catch block does nothing, no informative error message is returned.

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: ![image](https://github.com/langchain-ai/langserve/assets/633163/ea3cc91a-edbd-4d54-a8c4-67e070983d5a) So, there are two problems here: 1. The index.js file is being served with an incorrect mimetype, causing the playground to fail, and 2. When the playground fails, a blank page is returned. On 2, the HTML source code for the playground endpoint looks like this: ```html <body> <div id="root"></div> <script> try { window.CONFIG_SCHEMA = . . . window.INPUT_SCHEMA = . . . } catch (error) { // pass } </script> </body> ``` And thus, when the page fails to load, because the try/catch block does nothing, no informative error message is returned.
yindo added the playgroundbug labels 2026-02-16 00:18:17 -05:00
yindo closed this issue 2026-02-16 00:18:17 -05:00
Author
Owner

@eyurtsev commented on GitHub (Nov 20, 2023):

Thanks for reporting @parkerhancock

@eyurtsev commented on GitHub (Nov 20, 2023): Thanks for reporting @parkerhancock
Author
Owner

@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.

@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.
Author
Owner

@eyurtsev commented on GitHub (Nov 27, 2023):

Source of issue is: https://bugs.python.org/issue43975

@eyurtsev commented on GitHub (Nov 27, 2023): Source of issue is: https://bugs.python.org/issue43975
Author
Owner

@eyurtsev commented on GitHub (Nov 27, 2023):

Seems that mitigation is: https://docs.python.org/3/library/mimetypes.html#mimetypes.init

@eyurtsev commented on GitHub (Nov 27, 2023): Seems that mitigation is: https://docs.python.org/3/library/mimetypes.html#mimetypes.init
Author
Owner

@trannhatquy commented on GitHub (May 10, 2024):

@eyurtsev how to fix the langserve playground not found error. Thank you

@trannhatquy commented on GitHub (May 10, 2024): @eyurtsev how to fix the langserve playground not found error. Thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#44