streamlit-elements icon indicating copy to clipboard operation
streamlit-elements copied to clipboard

The image cannot be displayed due to an incorrect path.

Open IsmailDr13f opened this issue 7 months ago • 0 comments

When using the Card component from MUI within the streamlit-elements framework, I encounter an issue where images fail to render if I pass either a complete or relative path to the image attribute. Upon inspection, I found that the image path is incorrectly resolved: the tool automatically concatenates the path with the internal static directory (frontend/build) of the original streamlit-elements project. As a result, the actual file path becomes invalid, and the image cannot be displayed. This behavior poses a critical limitation: if I manually place image files inside the frontend/build directory to make them work, these files are at risk of being lost whenever the streamlit-elements package is updated or rebuilt, as this directory is managed internally and not meant for persistent custom assets.

IsmailDr13f avatar May 20 '25 09:05 IsmailDr13f