Question

The backend of my Magento installation is not loading CSS/JS. I have reached a point where I just cannot work out why this is happening and hoping that someone might have an idea.

This is what I am seeing:

enter image description here

I can also see that in pub/static/adminhtml/backend/en_US there is no css folder.

This is what I have tried to resolve this:

  • Confirmed .htaccess is present in the pub/static folder
  • In developer mode, I have ran the following commands:
bin/magento cache:clean
bin/magento cache:flush     
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
  • Set dev/static/sign to 0 directly in DB.

  • Built in production mode with:

bin/magento setup:upgrade
bin/magento deploy:mode:set production
  • Checked and reset all permissions
  • Checked var/log/ for any indications of errors - there is just this:
main.ERROR: Unable to resolve the source file for 'adminhtml/Magento/backend/en_US/css/styles.css' [] []
main.CRITICAL: Unable to resolve the source file for 'adminhtml/Magento/backend/en_US/css/styles.css' [] []
main.ERROR: Unable to resolve the source file for 'adminhtml/Magento/backend/en_US/js/theme.js' [] []
main.CRITICAL: Unable to resolve the source file for 'adminhtml/Magento/backend/en_US/js/theme.js' [] []

I have spent way too long searching for an answer on here, Google, etc. and it just seems to send me in circles with all suggestions being one of the above.

I am guessing it might be something simple, something I have overlooked but I am just not seeing it today. Any help will be appreciated.

Was it helpful?

Solution 2

So my issue seems to have been fixed now by completely removing the vendor folder and running:

composer install

I have no idea why this fixed the issue, I have never changed anything in that folder.

OTHER TIPS

Please try to run below commands

php bin/magento deploy:mode:set developer
rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* generated/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
chmod -R 777 var/ pub/ generated/
php bin/magento cache:clean
php bin/magento cache:flush

After running above command please try to refresh your Backend. Make sure that URL Rewrite also enabled.

Hope this will help you!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top