custom-cards/boilerplate-card

Browser errors using bundle

Closed this issue · 5 comments

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

That's not a bug in your code, that's you using raw.github.com. They serve all files with mimetype text/plain, so you can't use it to host your scripts.

@bramkragten so you think I should put it on a cdn rather than offer it as a bundle? I like the idea, in terms of people being able to update easily, but I know that plenty of people will not want to be reliant on a cdn to bring up their frontend. The unpkg issue comes to mind, so perhaps offering best practices for rollup and for cdn?

@balloob there's nothing related to raw.github.com in the generated file 🤷‍♂️ I'm using a local version of the file, not trying to use github to serve it, as well

ah, well then your local server serves the wrong mime type. check mime type in your network panel of chrome.

got it sorted with @ljmerza's updates. I'll post updates soon. Thanks.