The stylesheet http://localhost:3000/src/css/component.css was not
loaded because its MIME type, “text/html”, is not “text/css”
Reason for the error is,
you are allowed to access only public directory when its served on browser, so
-> First ../src/css/
by this way you can't access the file , it will consider this as route and try to give you html
-> Second , This is not the proper way to include css files :
<link rel="stylesheet" type="text/css" href="../src/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="../src/css/demo.css" />
<link rel="stylesheet" type="text/css" href="../src/css/component.css" />
Proper way to use the css file is like this ( from your react component js file ) :
import './css/component.css';
(react-scripts start
) React will automatically convert your css file into js and applies it.
Still if you want to use css files outside of react, you need to put all css files inside public folder (good to put inside public/css)
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/component.css" />
If you still have doubts please read :
https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started
Hope, this will clear all your doubts.
https://gitlab.com/menkudle/MERN-CommentBox
– Quay