How to embed a pre written website (in JS, CSS, HTML format) into streamlit for use

In my code, I did not write it in a modular form, and the logic of each step is important. However, when embedding components.html into streamlit, the following error will be reported. I am confident that my address and source files are executable. How can we avoid these problems in this situation?

I have tried many methods but have not been able to solve it

Hi @Brave, welcome to the forum!

In general, I would not recommend this approach. Streamlit is great for writing and hosting interactive apps with Python. If you’ve written an app in JS/CSS/HTML, then you would be better off not using Streamlit at all, and just hosting it as a static website elsewhere.

Could you share a simple reproducible script which shows this issue?