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).


1 Answer 1



$ 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.

  • didn't work, I think it may behave slightly differently when you use _module.less
    – Holly
    Commented Apr 26, 2017 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
    Commented Apr 26, 2017 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
    Commented Apr 26, 2017 at 14:54
  • 1
    I'm just using 777 on a dev enviroment Max, but good to point it out
    – Holly
    Commented Apr 26, 2017 at 15:47

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.