S
Solara4mo ago
ajnin

**Issue with Loading Static JavaScript and CSS Files Using `<script>` Tags in Solara**

Hello, I followed the docs - https://solara.dev/documentation/advanced/reference/static-files https://solara.dev/documentation/advanced/reference/asset-files The issue I am encountering with fetching static files inside a <script> tag in a Solara component. Here’s the scenario: I am using the solara.HTML component to include HTML content within my Solara application: solara.HTML(tag="div", my_html) In the my_html variable, I have included a script tag to load a JavaScript file: <script src="/static/assets/dhtmlxgantt.js"></script> The problem is that the JavaScript file (or any CSS file (I did this just to verify)) specified in the <script> tag does not get loaded. However, when I provide these paths using a <link> tag for CSS or JS, the files are available and load correctly. Could you please assist with how to properly serve and access static JavaScript files within Solara when using the <script> tag? Thank you!
Using static files and resources in your Solara application
When using Solara, you can host static files, like images, which will then be available at /static/public, in the ../public folder.
Incorporating your assets, styles, and logos into your app
Solara looks for overrides of certain style and asset files in the assets folder by default. You can use these to incorporate your branding into your dashboard or app.
1 Reply
ajnin
ajnin4mo ago
also in the network tab (F12) console I can see 404 for :8765/static/base/js/utils.js:1 :8765/static/base/js/namespace.js:1
Want results from more Discord servers?
Add your server