• Register
0 votes
176 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 5 3
6,930 points

Please log in or register to answer this question.

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.

9 7 4
38,600 points

Related questions

1 vote
1 answer 86 views
86 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 231 views
231 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 7 views
7 views
Problem: because its mime type ('text/css') is not executable, and strict mime type checking is enabled.
asked 3 days ago Muneeb Saadii 2.4k points
0 votes
1 answer 3 views
3 views
Problem: strict mime type checking is enabled. As you know its mime type ('text/html') is not executable
asked 3 days ago Muneeb Saadii 2.4k points
0 votes
1 answer 146 views
146 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, 2020 jwilliam 3.9k points
1 vote
2 answers 408 views
408 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
1 answer 15 views
15 views
Problem: Hello, I need help with my html project. I need to display the json information into a table. So when I load the page, it will automatically read the json format and then display the information into a table.
asked Nov 12, 2020 Grace Butan 340 points
0 votes
1 answer 12 views
0 votes
1 answer 45 views
45 views
I have this problem. Chrome continues to return this error
asked Dec 15, 2020 TeamScript 13.5k points