I'm deploying my static astro site to cloudflare pages, and am getting this error in the browser in the prod version of it:
mobile/:1 Refused to execute script from 'https://[root_url]/node_modules/flyonui/flyonui.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
this is the relevant code from the Layout.astro file:
<script
is:inline
data-astro-rerun
src="../../../node_modules/flyonui/flyonui.js"></script>
<script>
document.addEventListener('astro:page-load', () => {
setTimeout(() => {
if (
window.HSStaticMethods &&
typeof window.HSStaticMethods.autoInit === 'function'
) {
window.HSStaticMethods.autoInit();
}
}, 100);
});
</script>
The second one was to fix the script not getting reinitialized when doing a page transition, just fyi.