Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.Js: Resource Interpreted as Font but Transferred with MIME Type text/html

The icons on my website, which is being served up by Node.Js, are not rendering, and I am seeing the error indicated in the title. I am using this script for my server... https://github.com/joeeames/AngularFundamentalsFiles/blob/master/web-server.js

Below line 98 I added...

'woff':'application/font-woff'

I also...

npm install mime

But nothing I do seems to work. Does anyone know how how to solve this problem? The specific error from the console is...

Resource interpreted as Font but transferred with MIME type text/html: "https://<my_site>/bower_components/font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0".

I see similar errors for TTF and SVG types.

like image 326
Dan Forbes Avatar asked Aug 22 '14 17:08

Dan Forbes


1 Answers

It probably means that you are requesting a resource that doesn't have a matching route, so the server is sending down the index page. If you look at the contents of the request in the developer tools of your browser, you should see that it is an html document that is being returned. You need to diagnose why what you are requesting doesn't have a matching route besides the default route that serves up the index.html page.

like image 169
Joseph Eames Avatar answered Nov 15 '22 21:11

Joseph Eames