• Register
0 votes
240 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 142 views
142 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 404 views
404 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 32 views
32 views
Problem: because its mime type ('text/css') is not executable, and strict mime type checking is enabled.
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 8 views
8 views
Problem: Refused to execute script from 'http://localhost:8080/edit/bundle.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. I am using react-router and i got this error while using <Route path="/edit/:id" component={ ... ></div> <script type="text/javascript" src="bundle.js"></script> </body> </html> Please Help me in resolving this issue.
asked Apr 25 ochena 23.3k points
0 votes
1 answer 11 views
11 views
Problem: strict mime type checking is enabled. As you know its mime type ('text/html') is not executable
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 212 views
212 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: &ldquo;Because its mime type ('text/html') is not a supported stylesheet mime type&rdquo; 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
0 votes
1 answer 10 views
10 views
Problem: I am using the example from: Get JSON data from external URL and display it in a div as plain text To get information from a JSON with nested data but I am getting the result: [object Object] How can I get the NAME or JOB information? HTML <div id="result" style="color:red"></ ... ); }); JSON { "queries":[ { "query":{ "CODE":"555443567", "NAME":"NAME LASTNAME", "JOB":"JOB TITLE" } } ] }
asked 6 days ago ochena 23.3k points
0 votes
1 answer 2 views
2 views
Problem: ERROR in ./client/styles/main.scss Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example at Object.pitch (/Users/leongaban/projects/go/src/github.com/ ... "^6.24.1", "babel-preset-react-hmre": "^1.1.1", "babel-preset-stage-0": "^6.24.1",
asked Apr 25 Yeamin 22k points
0 votes
1 answer 3 views
3 views
Problem: I extracted css using extract-text-webpack-plugin in webpack 4. The CSS is exctacted but when i run npm run build , the css is extracted but i get a message on screen saying Entrypoint undefined = extract-text-webpack-plugin-output-filename.
asked 3 days ago jamuna1 30.2k points