问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/25452126/node-js-resource-interpreted-as-font-but-transferred-with-mime-type-text-html