MIME and GET error when trying to load external resource files like styles.css

The console is giving me this error:

Refused to apply style from 'http://[ip address]:8080/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

When I try to navigate to the css file thru the url, I get a GET error.

It seems like something is wrong with how my server is set up?

I am using the command:

au run --host [ip address]

to run my server because I am testing it remotely.

Any thoughts are greatly appreciated

1 Like

Open a new browser tab to visit 'http://[ip address]:8080/styles.css', I guess you will surprisedly see a html page.

Are you using webpack? Where is your styles.css?

Update:

I get a GET error

I guess that’s what happened. The dev service cannot find style.css file, so it returns 404 html page (with is html, not css).

1 Like

So how do I fix this?

According to what I understand, Aurelia is supposed to be able to handle css files?

1 Like

What I don’t understand is that I am using styles.css just like the getting started projec t - Contact Manager, and that project found the styles.css file just fine?

What am I missing?

1 Like

Are you able to share the project somewhere? It most likely is that either the file is misplaced somewhere or a simple configuration issue. If you create a new project it should work out of the box.

1 Like