Strict MIME type checking issue

Created on 18 April 2018, over 6 years ago
Updated 24 May 2024, 4 months ago

In my custom module, I am adding a javascript file using libraries. Now when I visit the page, it gives me following error "Refused to execute script from 'http://dev.local.com/user/1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
I thought this is related to my custom module but when I checked for other core modules which also adds the js file using library, they have the same error and it blocks the script from loading. If I uncheck the option aggregate css and js from the performance page, this error seems to go away.

🐛 Bug report
Status

Closed: won't fix

Version

10.1

Component
Javascript 

Last updated 1 day ago

Created by

🇮🇳India asit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States dpagini

    I actually am running into a very similar issue, but I don't know how to recreate. My production site will occasionally have a page that does not load javascript... It has 1 aggregated file that's supposed to be there, but instead my page prints: <script type="text/javascript" src="/"></script> which points to the homepage, and is HTML and not js, so I have no scripts on my page. I do use the advagg module, so not sure if that's related...?

  • 🇺🇸United States dpagini

    Just revisiting this one, and my comment in #13... I suspect that for my issue, this was somehow related to using `advagg` module, and when Drupal made the aggregation changes in 10.1, I believe, we stopped using advagg and I have not seen the issue again since we switched.

Production build 0.71.5 2024