Cannot import fonts into meteor - disallowed MIME type (“text/html”)


when I would like to import into client javascript file any CSS, where are used some fonts or font icons (for example bootstrap), I get the following error in console and therefore fonts ar not included and not works.

Loading module from “http://localhost:3030/app/ionicons/ionicons.suuqn5vt.js” was blocked because of a disallowed MIME type (“text/html”)

Thank you very much for each help.

I guess file doesn’t exists as points to the wrong place. Copy URL from the error to Browser to see what’s up there

Hi, thank you very much for your answear. After deeper investigation, I found the real reason. It’s because in CSS is set relative path to the font. When I’m running the app on url /admin the font path is /public/fonts, but when I will change from /admin/smiling, the fonts path is also changed to /admin/fonts, what is a mistake.

Also the problem is, when I would like to use fonts from NPM packages. It’s not possible. And what is bigger problem, when I’m using some bigger UI installed with NPM, for example KendoUI which includes the fonts by it self.

I was expected something like from webpack - automatically move to public/fonts folder all the fonts from all places, which are included into CSS.

I maked a small hack, I extracted all fonts and copy to /public/fonts and I was override the font-face CSS to the new with the absolute path and it is working, but I’m sure, that this is not the best solution (but I didnt found nothing better).

Thank you @dr.dimitru

1 Like