I’m developing a Blazor application and encountering an issue with persistently loading an external JavaScript file (flowbite.min.js). Initially, I load this file when the application starts, but upon navigating to another page, the file seems to be lost, requiring a page reload to load it again.
Here’s the setup:
I have a Blazor application structured with multiple pages.
I have followed this tutorial for setting up everything with Tailwind and Flowbite – https://dev.to/themesberg/learn-how-to-install-blazor-net-with-flowbite-and-tailwind-css-2inn
However, upon navigating to another page within the application, the flowbite.min.js file seems to be lost, and functionalities dependent on it cease to work until the page is reloaded.
I’m still unsure about the best approach to handle this issue effectively. Additionally, I’m wondering if it’s considered good practice to mix Blazor with an external JavaScript library like flowbite.min.js, or if there’s a better way to integrate such libraries into a Blazor application.enter image description here
Could anyone provide insights into the following:
What might be causing the loss of the flowbite.min.js file upon page navigation?
What is the best approach to persistently load external JavaScript files in a Blazor application?
Is it advisable to mix Blazor with external JavaScript libraries, and if not, what is the proper way to integrate them?
Any advice, tips, or examples would be greatly appreciated. Thank you!
Ivailo Gramatikov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.