cancel
Showing results for 
Search instead for 
Did you mean: 

CSS/JS not loading in frontend/backend only in production mode?

CSS/JS not loading in frontend/backend only in production mode?

Hi all,

after spending some hours with this issue I now dare to ask. I think I have overseen something stupid. And yes, I i have all sorts of tutorials  read... My problem: Site is working properly in developer mode. After switching in production mode my, I run static content deploy command wich runs without any errors. But after that admin and frontend are missing all styles. Seems although deploy command works, static files are not written, pub/static is missing files and console error says require.config failed to load. strangely, I seem to have the opposite problem of those who have in the developer mode problems with the symlinks, because the developer mode with the symlinks works wonderfully, the symlinks are written without problems in pub / static. Version 2.1.7

2 REPLIES 2

Re: CSS/JS not loading in frontend/backend only in production mode?

Hi @dollylondhb23e 

 

Can you try once by removing version number by just following below article:

 

https://www.manishmittal.com/how-to-remove-deployment-version-number-from-static-content-file-paths-...

 

After that just run static-content deploy command and cache:flush command. Please check your files and folders too. Thanks

Manish Mittal
https://www.manishmittal.com/

Re: CSS/JS not loading in frontend/backend only in production mode?

Hi @dollylondhb23e 

 

Check the base URL which is being used for css/js/media files and it might be issue of permission of pub/media pub/static folder, please give permission by below command :

chmod -R 777 pub/media/ pub/static/ var/

deploy static-content with below commands :

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush 
Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy