0

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 MIME type text/html: "http://localhost:8080/controlpanel/users/css/style.css". 

I checked to see if my file location was not correct but it is correct

Programmer345
  • 540
  • 2
  • 15
  • 29

2 Answers2

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.

recursive
  • 83,943
  • 34
  • 151
  • 241
1

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>
   <link rel="stylesheet" type="text/css" href="./css/base.css">
</head>

It worked.

Amar
  • 61
  • 1
  • 5