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

Goose84
  • 2,601
  • 2
  • 28
  • 61

3 Answers3

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

Pascal LE MINH
  • 301
  • 1
  • 2
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.

Shubham Khandelwal
  • 1,076
  • 6
  • 10
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.

Shoaib Munir
  • 9,404
  • 10
  • 49
  • 106