I’m trying to use components.html to load a local HTML file, but including CSS and JavaScript files in it throws an error “Failed to load resource: the server responded with a status of 404 (Not Found)” as it’s trying to access “http://localhost:8501/bootstrap.min.css” instead of the bootstrap.min.css in the local folder. Any idea how to solve this?
On a side note, is there any way to use bi-directional components without React or TypeScript? Or is rewriting an HTML site to those formats the only way?
CDNs seem to solve the problem for CSS and js scripts, but it seems like the problem also persists for local files like images and videos as well, which is still an issue.
The last 2 links require some form of TypeScript, hence prompting me to ask the question. The first link looks to be what I’m looking for though, I’ll give it a look!
Cool! It works well, I’ve used it a bit and I know another creator that loves this way of doing eheh we can namedrop if you have issues with the non typescript way.
Also you can absolutely do the reactless component in vanilla JS, no Typescript (rename to .js and remove any sign of types from the file), only the npm part will be required.
That does solve the issue, thanks. However, I’m trying out the implementation without any frontend tooling, and that method does not call components.html, so I’m unsure how to access the static videos for that.
Also, using CDNs are fine for external CSS and JS files, but what about local CSS files I made myself? Do I need to try to host them online and convert them to a CDN in order to implement them?
That would be great! The solution has been working decently well for me, other than a few issues such as video controls being weird. I would love to have more references on this way of implementing it.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.