0

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.

3 Answers 3

0

Try to run the following commands :

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/
2
  • it also occurs on clean magento 2.4.7 version :) Doesn't occur on clean 2.4.4
    – Przmak
    Commented Jun 18 at 12:51
  • Then try to install again from the fresh file of 2.4.7, because these not found by other into that same version. Commented Jun 18 at 13:32
0

Try to run the following commands :

php bin/magento cache:clean

php bin/magento cache:flush

php bin/magento indexer:reindex

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f sudo chmod -R 777 var/ generated/ pub/

1
  • it also occurs on clean magento 2.4.7 version :) Doesn't occur on clean 2.4.4
    – Przmak
    Commented Jun 18 at 12:51
0

Do not forget to update lib/internal and lib/web. It's not automatic (means not carried out by composer update)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.