I recently did upgrade my magento from 2.4.4 to 2.4.7
While running frontend in production mode, there are lots of issues regarding js file load.
Example:
The resource from “https://magento.local/static/version1716768798/frontend/XXX/base/en_GB/mage/common.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
As I understand, the file which supposed to be loaded, should be mage/common.min.js not mage/common.js
Looking in the developer console in firefox/chrome/edge I can see that the file loading goes as follow:
https://magento.local/static/version1716768798/frontend/XXX/base/en_GB/mage/common.min.js
https://magento.local/static/version1716768798/frontend/XXX/base/en_GB/mage/common.js
For unknown reason, the file is loaded twice. The first one is a success, the other is not.
The issue only occurs in production mode.
It seems this issue is somehow related to require-config.js All files that are failing are somehow put somewhere within the 'deps' node.
Example: html/vendor/magento/module-theme/view/frontend/requirejs-config.js
deps: [
'mage/common',
'mage/dataPost',
'mage/bootstrap'
],
All those are loaded twice(firstly minified and then non-minified) and the non-minified fails to load.
Any clues, why this could happen or where to look for solution? My last gas is to install fresh 2.4.7, check it there and apply all the updates I have.