Cache/jsLanguage cannot be used / The resource from “...legacy/cache/jsLanguage/Home/en_us.js was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

What´s the problem? I upgraded from 8.5.0 to 8.5.1. After that the languages (German and English) don’t load anymore, but always fall back to the predefined language (English).

The dev console shows: The resource from “…legacy/cache/jsLanguage/Home/en_us.js was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)
Refused to execute script from ‘…legacy/cache/jsLanguage/en_us.js?v=KUKPQnJ_K4y3gsrVCGygVQ’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled

The folder permission on the cache folder is set to 775 recursively and owner is the web server user.
So Resource Blocked Mime Type Mismatch is not the solution.

It seems like this file gets the wrong MIME type assigned (“text/html”) even though it is a javascript file. Any idea what could be the problem?

Try a Quick Repair and Rebuild, and a Rebuild languages, and all Rebuild Javascript options.

Then a browser hard-refresh.

Then tell us if that solved anything :slight_smile:

Hello @pgr ,
thanks for your answer. I did Quick Repair and Rebuild, and a Rebuild languages, and all Rebuild Javascript options + browser hard-refresh. The problem remains.

By the way: All Rebuild Javascript options returned an
“undefined”.

Do you have another idea?

Check code or issue here:

SuiteCRM-v8.x

Pay attention to the rest of the app. If you see more undefineds, that’s a bad sign, usually caused by ownerships/permissions issues. Sometimes these are trickier than usual; problems with Selinux, some htaccess file, SetGID and SetUID bits in directories…

Or maybe you just have some misconfiguration on your web server regarding MIME types. I can tell you that your issue is not a common issue with SuiteCRM. First time I’ve seen it after 8 years in these forums (and I read everything here :sweat_smile: ).

Thank you @pgr for the tips. I tried several things but could not figure out the problem. So unfortunately it is more convenient to reinstall everything instead of finding the cause of the problem… I will report back in case I figure out the problem.

1 Like

You’re probably getting a text/html error message back (“cannot access cached file” or similar), instead of the actual javascript file, because your cache directory permissions were possibly not set recursively. And the browser blocks displaying the text error message because text content type of what it received does not match javascript content type of what it expects!