0

I want to set a live environment for my web application. I'm using AngularJS and NodeJS (MEAN) and I want both to run live simultaneously. What I did is, I installed live-server through npm and started server by

live-server --`host=192.168.XX.XX --port=9999`

It is showing the following error:

Refused to apply style from 'http://192.168.XX.XX:9999/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Also tried giving the path to my project folder in public by

live-server --`host=192.168.XX.XX --port=9999` --open=public

but facing same error. Please help! Thankyou

Abhishek Pankar
  • 473
  • 4
  • 11
  • Please check your css files for unnecessary texts and comments .Can you post a snippetof how you are including your css files – Shubh Jan 20 '19 at 03:29
  • Possible duplicate of [Stylesheet not loaded because of MIME-type](https://stackoverflow.com/questions/48248832/stylesheet-not-loaded-because-of-mime-type) – georgeawg May 06 '19 at 15:39

2 Answers2

0

First I would check to see if you have a typo in the path name in the script tag. If you have an extra / in the name then you will get this error.

Second, try minifying the css file.

Lord Elrond
  • 9,016
  • 3
  • 20
  • 50
0

It was just the other index.html file i placed outside the public folder. By the way, one solution worked for me.

Place this link in the head of your HTML.

<base href="/" target="_blank">
Abhishek Pankar
  • 473
  • 4
  • 11