Hi all, I loaded ts/js into my hugo template but I’m stuck on this error:
localhost/:1 Refused to execute script from 'http://localhost:1313/js/public.min.96c0ed8357c9dddb780bbc4aff81e7fde27919c5b644b2e5ac344d3307bd08ef.ts' because its MIME type ('video/mp2t') is not executable.
The file that is linked is this:
import "../sass/branches/index.scss";
import NavMarketing from "./utils/nav_marketing";
// Bind events that happen on DOM Load
document.addEventListener("DOMContentLoaded", () => {
NavMarketing.init();
});
It seems other people have run into this issue and solved it specifically for Angular. I didn’t find any solutions that were relevant. Any pointers in the right direction are appreciated.
Additional info
This is what my scripts partial looks like, in case that is relevant:
Will replicate in a separate repo next time. Figured this one out. Basically the answer is you have to use webpack (which I thought hugo would take care of transpiling js automatically).