Title: Failed to load module script
Last modified: July 22, 2022

---

# Failed to load module script

 *  Resolved [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * (@insecttrojan)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/)
 * when i have enable the optimize javascript its says me
 * Failed to load module script: Expected a JavaScript module script but the server
   responded with a MIME type of “text/html”. Strict MIME type checking is enforced
   for module scripts per HTML spec.
 * [http://www.insect.gr/:1](http://www.insect.gr/:1) Refused to execute script 
   from ‘[https://www.*.gr/wp-content/cache/autoptimize/js/eso.aba90b1c.js&#8217](https://www.*.gr/wp-content/cache/autoptimize/js/eso.aba90b1c.js&#8217);
   because its MIME type (‘text/html’) is not executable, and strict MIME type checking
   is enabled.
 * i have disable now
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffailed-to-load-module-script%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15848910)
 * The root cause is a “file not found” which is returned as a HTML reponse, so 
   indeed that cannot be executed. Based on the error-message the issue is with 
   a JS-module, which can be used to intelligently split and load JS files, importing
   when needed.
 * Now I had a look at the HTML source, but I don’t see any `<script type="module"`
   being used (at least on the homepage) and AO would not act on those (it only 
   acts on scripts without a type attribute or with type `text/javascript`) so I’m
   still pretty much in the dark here.
 * Did this happen on a specific page, or on all pages? Did this happen while logged
   on, or also logged out (anonymous user)? Do you have a staging site where you
   could leave it broken for me to check?
 *  Thread Starter [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * (@insecttrojan)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15848942)
 * ok i have it now broke it is happening on all blog posts like
    [https://www.insect.gr/10-pragmata-pou-den-gnwrizes-gia-tin-apentomwsi-spitiou/](https://www.insect.gr/10-pragmata-pou-den-gnwrizes-gia-tin-apentomwsi-spitiou/)
 *  Thread Starter [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * (@insecttrojan)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15849039)
 * is about to do with addtoany when i enable optimize js it says me Something is
   preventing AddToAny from loading. Try disabling content blockers such as ad-blocking
   add-ons, or try another web browser. i fixed it disable the Cache AddToAny to
   local and it is working
    -  This reply was modified 3 years, 10 months ago by [Insect Trojan](https://wordpress.org/support/users/insecttrojan/).
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15849279)
 * So addtoany has an option to cache it locally and when you enable that it breaks
   when autoptimized, correct? hard to say what is going on there, but my guess 
   is they are loading the JS as a module but doing it wrong somehow, causing AO
   to aggregate/ optimize it anyway.
 * you can try re-enabling “cache local” and add `addtoany, add-to-any` to the JS
   optimization exclusion list maybe?
 *  Thread Starter [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * (@insecttrojan)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15849312)
 * ok it not working with exclusion list i will talk to addtoany to thanks a lot
   for your help
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15851142)
 * I’ll close this topic as resolved, but feel free to keep me posted on progress
   at a2a side! 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Failed to load module script’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/failed-to-load-module-script/#post-15851142)
 * Status: resolved