Hai, this is awsome library.
Iāve an issue. I want to insert html which load local css and local js to my streamlit app. When I run my html independently, itās work. But when I insert html string in streamlit.v1.components.html the local css and local js canāt be loaded. There are error in inspect console
GET http://192.168.99.59:8501/style.css
[HTTP/1.1 404 Not Found 28ms]
GET http://192.168.99.59:8501/js/app.js
[HTTP/1.1 404 Not Found 30ms]
Hello @Khanifudin_Al_Khasan, welcome to the community!
If you try to reference local CSS and JS files from your HTML and expose it through Streamlit, my guess is Streamlitās server is configured to look for local files from the static
folder of its install folder and not from the root of your project (see my answer here for more info)
So youāll either need to move your CSS/JS to the static
folder, or host them on a CDN/S3/Github public repo to reference them online.
Let me know if this works as I havenāt actually tested my theory
Happy Streamlitinā
Fanilo
1 Like
Thanks @andfanilo
Itās work for css, but there is error in my .js
Uncaught TypeError: navigator.mediaDevices is undefined
while itās fine when I run independently.