Refused to execute script because its MIME type (‘text/HTML’) is not executable, and strict MIME type checking is enabled.

Hi, friends recently, I was working on one task to enable bundling and minification in ASP.NET MVC4 web application that was already running on the internet. I have implemented the bundling and minification and everything was working fine on the local machine but once I deployed the application to the dev environment. Some new errors seem to appear once I run the application as shown below in figure 1.

issue

Figure1: Refused to execute script because its MIME type (‘text/HTML’) is not executable, and strict MIME type checking is enabled.

So the whole Javascript libraries dependent on each other started to break, as Jquery file was not loaded successfully. So after load of searching, I come across one work by adding the following line in the web.config files under <System.web> <module> element.

<remove name=”bundleModule”/>

<add name=”bundleModule” type=”System.Web.Optimization.bundleModule”/>

After implementing this workaround I was able to resolve the problem. I hope this short solution for the error will be helpful to you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.