In a custom module I've created I'm using a _module.less file in it. At first it worked but any changes I make to it are not updating on the frontend.

I think it must be a cache issue but so far everything I've tried to fix it has not worked:

php bin/magento setup:upgrade; php bin/magento setup:di:compile;
php bin/magento cache:clean; php bin/magento setup:static-content:deploy;
rm -rf var/cache/; rm -rf var/generation/

I'm working in developer mode.

Any ideas?


I checked Less files in custom modules but unfortunately this does not answer my question. It explains how to use LESS in a custom module but not how to troubleshoot the issue I am having with the cache other than what I've tried already (see above).



$ rm -rf var/cache/* var/full_page/* var/generation/* var/view_preprocessed/* pub/static/* 

This way Magento recompiles less files and also deploy all needed files again.

| improve this answer | |
  • didn't work, I think it may behave slightly differently when you use _module.less – Holly Apr 26 '17 at 9:42
  • actually it worked after I ran rm -rf pub/static/ , so in total I ran rm -rf var/cache/; rm -rf var/generation/; rm -rf var/view_preprocessed/; rm -rf pub/static/ ; chmod -R 777 . – Holly Apr 26 '17 at 9:46
  • Please don't use 777! Magento2 doesn't need 777 als CHMOD nowhere. Highest is 755 for folders and 644 for files, depending on your webserver. But most likely errors won't appear if you use those. – Max Apr 26 '17 at 14:54
  • 1
    I'm just using 777 on a dev enviroment Max, but good to point it out – Holly Apr 26 '17 at 15:47

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.