4

I use Magento 2 custom theme and when I made changes to .less file, I wanted to compile files, so I deleted pub/static folder and made deploy: php bin/magento setup:static-content:deploy. After that, no css files are found in pub/static/frontend/<Theme>/default/css. Also, when I use grunt less, I got errors:

>> Destination pub/static/frontend/Magento/blank/en_US/css/styles-m.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/styles-l.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/email.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/email-inline.css not written because no source files were found.

I am in a developer mode.

Does anyone have any solution for this?

Thank you

  • 'pub/static' should be writable. – Sohel Rana Jun 15 '16 at 14:18
8

You need to run grunt exec and then grunt less.

  • Could not get grunt watch to work after clearing static-content, this solution solved it. Thanks @Aaron! – jamil Jun 21 '17 at 15:21
  • Great! Can you mark this as the answer? – Aaron Jun 24 '17 at 23:44
  • 1
    It wasn't my question, just letting other users know this is a working solution :D I wish you many upvotes – jamil Jun 26 '17 at 16:28
2

It could be because you deleted the .htaccess file from pub/static. It can be found here https://github.com/magento/magento2/blob/develop/pub/static/.htaccess. Next time run rm -rf pub/static/* var/view_preprocessed/* instead of deleting the directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.