Skip to content Skip to sidebar Skip to footer

Resource Interpreted As Stylesheet But Transferred With Mime Type Text/html Error In Console

I am trying to include flexslider in my Angular App and getting a following error after i included the flexslider css file Resource interpreted as Stylesheet but transferred with

Solution 1:

Your web server is not serving the resource using the correct Content-Type in the HTTP header. Your web server should have a setting for MIME types by file extensions, but that depends what server you are using.

Solution 2:

I've faced the same issue. Well, I was just trying to use a servlet to load welcome jsp page, which contains a .css file in header.

<head>
   <link rel="stylesheet"type="text/css" href="css/base.css">
</head>

And I got the same error "Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/webapp/css/style.css"

When I used developer tools in chrome, under 'Network' tab, two calls were made when hit my webapp's landing url "http://localhost:8080/webapp/"

I changed my default servlet url from "/" to "/index" in web.xml

<servlet-mapping><servlet-name>NextServlet</servlet-name><url-pattern>/index</url-pattern></servlet-mapping>

And then added "./" to href,

 <head>
   <linktype="text/css" href="./css/base.css">
</head>

It worked.

Post a Comment for "Resource Interpreted As Stylesheet But Transferred With Mime Type Text/html Error In Console"