Skip to content
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

stlite does does support custom streamlit components that inject react dependencies #1111

Open
intelligentestech opened this issue Sep 8, 2024 · 0 comments

Comments

@intelligentestech
Copy link

intelligentestech commented Sep 8, 2024

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 
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant