4

I'm testing some small LESS changes in my theme. After every change I delete the contents inside:

pub/static/frontend/mytheme

and

var/view_preprocessed

Then I reload my site and the contents of var/view_processed (css and source folders) are not created so the new LESS changes aren't applied. However the site loads fine with the previous LESS settings.

After visiting 10-15 pages the css and source folders are created again and I can see my changes finally.

I constantly delete the Magento cache so thats not the issue. I've also set Firefox and Chrome to not save cookies, history, etc. Permissions have been set to 777 to discard that possible cause.

Why dont the contents of var/view_preprocessed folder get created right after the first reloading of my site?

  • php bin/magento setup:static-content:deploy – Vaibhav Ahalpara Oct 25 '16 at 8:52
2

You can't get view_processed folder until you deploy the content in site.

You must use deployment command to regenarate the view_processed folder.

php bin/magento setup:static-content:deploy

Now you can check inside var folder.

Now view_processed folder is appear.

  • I'm in development mode? can I delete view_processed? CLI says deploy is not required for dev mode – ravisoni May 7 '18 at 6:09
  • No for deployment its not required – Rakesh Jesadiya May 7 '18 at 6:14
2

delete all folder inside <magento-root>/var/* because var/generation folder also cached something.

delete var/* is not a problem because when page load its automatically get generated.

then clear you browser cache, load your page.

suppose still the problems remain please follow the below link instruction. don't need to delete every time pub/static/* below link have given idea about this.

https://stackoverflow.com/questions/36454314/simple-style-change-does-not-apply/36510694#36510694

have good luck.

  • I think the problem is related to browser. Althoguh I set it to not save any cache information, it seems it is still doing it anyways. I have to clear it every time. – Luis Garcia Apr 22 '16 at 16:53
  • Deleting everything inside /var and pub/static saved my life thanks @bilal – ravisoni May 7 '18 at 6:14
0

If you enable developer mode. Magento 2 come start with default mode

php bin/magento deploy:mode:set developer

Static files in pub/static/frontend or pub/static/adminhtml will automatic re-generate after reload with clear cache. Reload it severals time
If you modify requirejs-config you should remove file in pub/static/_requirejs too
Remove files in pub/static will make all your changes updated

  • This seems not to be true. As long as there is stuff in view_preprocessed, that one is taken iiuc. Stuff in there does only get updated with static-deploy, even in developer mode (although then static-deploy needs to be called with --force parameter, because magento tells you the files are not used in dev-mode....). – Felix Dec 4 '17 at 18:45
-1

run this command:

rm -rf var/* pub/static/*

then redeploy static content using the command below:

php bin/magento setup:static-content:deploy -f

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.