whitphx/stlite

stlite does does support custom streamlit components that inject react dependencies

Opened this issue · 0 comments

For example, streamlit_code_editor. The issue is that while it seems to work at first, if the react component starts to request any additional files / bundles, the web server hosting stlite is asked to serve them, instead of the web server inside stlite.

As a specific example, below are the console errors when I load stlite from a file on my local machine https://localhost:44339/PageStreamlit_embed.html and use this simple python script:

import micropip
await micropip.install('streamlit_code_editor')

import streamlit as st
st.title("Code Editor")

from code_editor import code_editor
response_dict = code_editor("select * from tb_documents;", lang="sqlserver")
about:srcdoc:1 
 Refused to apply style from 'https://localhost:44339/PageStreamlit_embed.html/bootstrap.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
about:srcdoc:1 
 
 GET https://localhost:44339/PageStreamlit_embed.html/static/js/2.a0802062.chunk.js net::ERR_ABORTED 404 (Not Found)
about:srcdoc:1 
 
 GET https://localhost:44339/PageStreamlit_embed.html/static/js/main.b5a85557.chunk.js net::ERR_ABORTED 404 (Not Found)
VM5208:2 
 
 GET https://localhost:44339/PageStreamlit_embed.html/437de94….js net::ERR_ABORTED 404 (Not Found)
VM5208:2