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.

  • Delete all folder in pub/static/ expect .htaccess. Run command: php bin/magento setup:static-content:deploy Good luck. Oct 23, 2019 at 12:04
  • @RanjeetKumar Yes, as I said, I have tried that. Running setup:upgrade empties that folder anyway. Oct 23, 2019 at 12:25

2 Answers 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.


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!

  • Yes I have ran all of those commands in that order more than once and same issue. Forgot to mention above, checking rewrite was enabled was one of the first things I tried. Oct 23, 2019 at 12:26
  • Still you're not able to open backend ? Oct 23, 2019 at 12:27
  • Nope. CSS is not being generated. Also, 777 on pub directory is an incredibly bad idea! Oct 23, 2019 at 12:27
  • Can you please press CTRL + U in your browser and then check what is your locale there ? Oct 23, 2019 at 12:28
  • Yeah thats en-US Oct 23, 2019 at 12:32

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.