• Register
0 votes
94 views

Problem :

Encountered mime type error and looking for its solution
because its mime type ('text/html') is not executable, and strict mime type checking is enabled.
6.9k points

1 Answer

0 votes

Solution :

Please use express.static() if you are using Node.js.

You need to simply pass the name of the directory where you are keeping your static assets to express.static middleware to start facilitate serving the files directly. 

e.g. if you are keeping your images, CSS, and JavaScript files in a directory whose name is public, then you can follow below approach :

 app.use(express.static('public'));

This approach helped me in resolving my issue.

36.1k points

Related questions

1 vote
1 answer 47 views
47 views
Problem : I am getting mime type error because its mime type ('text/plain') is not executable, and strict mime type checking is enabled.
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 73 views
73 views
Problem : I am trying to use the reactrouter but i am getting following error because its mime type ('text/html') is not executable, and strict mime type checking is enabled
asked Nov 13, 2019 peterlaw 6.9k points
0 votes
1 answer 51 views
51 views
Problem : I have the javascript application and when I try to run it on firefox I am facing the below error on the console: “Because its mime type ('text/html') is not a supported stylesheet mime type” Now I am completely confused because of this error. Kindly somebody let me know how can I resolve my above error?
asked Jan 29 jwilliam 3.9k points
1 vote
2 answers 91 views
91 views
Problem : Looking for solution on bellow npm error npm err! this is probably not a problem with npm. there is likely additional logging output above.
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
2 answers 185 views
185 views
Problem : I have below problem. Chrome continues to return below error “Resource interpreted as stylesheet but transferred with MIME type text/html” My files affected by above error are just a Style, chosen and jquery-gentleselect (other CSS files that are imported in a ... without error). I have already checked the MIME type and text/css is already on a CSS. How to resolve my error?
asked Jan 22 jwilliam 3.9k points