2

When upgrading to Magento 2.4.2 all of the core css is missing front both the back and frontends.

Looking at the source I see no reference to such lines such as

<link  rel="stylesheet" type="text/css"  media="all" href="https://www.example.test/static/version1624020941/frontend/vendor/theme/en_GB/css/styles-m.css" />

Also stuff like the fav icon is not loading and reverting back to the Magento default

Anyone one got any advice

1
  • Please confirm your root path is pub directory.
    – Amit Saini
    Commented Jun 22, 2021 at 3:34

3 Answers 3

10

What is the exact version of PHP you are using?

If you use php 7.4.20

Edit that php.ini file and find the section [Pcre] and add this line at the bottom of that section :

pcre.jit=0

Restart your PHP

see : Magento doesn't include theme.css in html

4
  • 2
    Dude if I can buy you a beer you just let me know how!!! I've spent the best part of 20 hours debugging this thinking it was something I had done! Lifesaver
    – Goose84
    Commented Jun 23, 2021 at 20:20
  • 1
    What @Goose84 said! I've been trying to resolve this for over a month now. Thank you so much! Commented Jun 23, 2021 at 20:41
  • I had this same problem. This fixed it right up. Amazing. Thank you! Commented Oct 15, 2021 at 15:03
  • Thanks You very much
    – Ajay Jain
    Commented Dec 21, 2021 at 14:14
0

First of all try to remove that version from css path this can be done either form admin or we have to run one db query.

From Admin you can disable it from

Stores > Configuration > Advanced > Developer > Sign Static Files

from database you can hit below query in "core_config_data"

insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0); 

For more information please check this link.

After these above changes run static content deploy command:

php bin/magento setup:static-content:deploy
php bin/magento cache:flush

Hope this will help you.

0

Try these two solutions, it might help you

Solution 1:

in app/etc/di.xml find the virtualType name="developerMaterialization" section. In that section you'll find an item name="view_preprocessed" that needs to be modified or deleted. You can modify it by changing the contents

From Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
To Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Delete the files under pub/static to get rid of any existing symlinks.
Note: You may want to be careful not to delete the .htaccess file.

run deployment script and check if your issue is resolved.

Solution 2:

override vendor/magento/framework/Filesystem/DriverInterface.php

probably on line 20, change permission to 0755
and probably on line 25, change permission to 644

Hope one of the above solution resolve your issue.

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.