kisiel kisiel - 1 month ago 18
Sass (Sass) Question

Windows 10, resource interpreted as Stylesheet but transferred with MIME type application/octet-stream

I have a serious problem with the interpretation of css in my browser. I tried most of the solutions available here and on the internet. I Checked regedit, my header section and other...
All the time I get an error

resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
. I tried on IE, Opera, Chrome, Firefox. I work on Windows 10 64bit,RubyMine IDE and I try run a simple html with external file SCSS.

My test html file:



<html>
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="../src/buttons.scss" media="screen" />
</head>
<body>
<h2>CSS Buttons</h2>
<button class="success_button"> Button </button>
</body>
</html>


Scss file:

// buttons

.success_button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}


please help

Answer

I may be wrong, but I don't think you can serve .scss files directly to the browser. It has to be compiled down to .css for the browser to parse/understand it. You can either compile to .css in a build job as you develop or deploy, or I believe there is a way to have the server parse the SCSS before serving it up. But I believe that is the issue-- the browser is getting a file with the wrong extension and isn't really sure what to do with it.

Comments