Hey @usasacm, could it be an issue with the URL in <script src="/static/mermaid.esm.min.mjs"></script>? I believe in order to for this to work when hosted via Streamlit, you would need to place that file in Streamlit’s static folder wherever Streamlit is installed. This command should provide the path where you have to copy the file: python -c "import streamlit as st; print(f'{st.__path__[0]}/static/static/')"
If mermaid loads more assets, they have to be placed accordingly.
Note that when you install a new version of Streamlit or do changes to your Python environment, you would need to place the assets again accordingly.
@usasacm for me it works with a test file! A wrong content type hints towards the fact that the file is not found correctly. For the src path you have provided, the file has to be stored under <streamlit_package_path>/static/app/static/mermaid.js
@usasacm Yeah I think that’s the wrong path. You have put it in the folder where your app script is stored, but you have to put it into the folder where the Streamlit library is stored. This is what I meant with
This command should provide the path where you have to copy the file: python -c "import streamlit as st; print(f'{st.__path__[0]}/static/static/')"
@usasacm what’s the output of the command for you? If it points you to the .static folder then you might need to put it there.
For me, the output is for example ~/debug/venv/lib/python3.12/site-packages/streamlit/static/static/ which is where Python packages are installed for me.
@raethlein , Good day/
This manual says that only pictures can be stored in the ./static/ folder, other extensions receive content-type = plain text. And other types of files must be hosted outside the application.
So my question is where should third party javascript libraries like jquery etc be stored.
I apologize for my stupidity