Reputation: 206
This error shows only in chrome. I am searching this issue but not yet found any
satisfactory solution.I attached a screenshot of that error. Please suggest some idea for this. Error image
Upvotes: 13
Views: 58438
Reputation: 21
Solution:
In my case, the problem was an empty @GetMapping
in one of my Controllers. I deleted it and the problem was gone.
I think the same answer will help someone who's having this similar problem and context ; e.g. JSP.
Background:
I had the same problem using Spring Boot and FreeMaker.
Upvotes: 2
Reputation: 11
Was having the same problem using firebase hosting, the solution was to move the style sheets to the "public" folder, i am guessing this is because it wasn't being deployed.
Upvotes: 0
Reputation: 15031
Someone in my team had put the <link></link>
tags for the css were above and outside the <head></head>
tags in the masterPage.html
file.
When this .html file was converted into the masterPage.master
file, we got these errors. resolution was to place the <link>
tags inside the <head>
tags after which the converted .master
file worked as intended.
Adding this here because this cause was not covered on stackOverflow, including this post - hope it could help someone in the future
Upvotes: 0
Reputation: 491
I've found that using a path that includes the domain, rather than just a relative path to the file, fixes the issue.
I.e:
src="https://<domain>.com/public/css/style.css"
rather than:
src="../../public/css/style.css"
I don't have a reason as to why this is the case. Perhaps something to do with the way static files are being served, or because it needs to be served over https
. I'm using Firebase to host / serve.
Note that this works for both css
and js
files, and explicitly setting the MIME type didn't have an effect for me.
Upvotes: 0
Reputation: 82986
Stylesheets should have a MIME type of text/css
. Your server is serving up a HTML document (probably a 404 NOT FOUND error page) when it should be serving a CSS document.
Upvotes: 20