Magento2: after deleting the pub / static folder and deploying, no css files found

I searched on the Internet but did not find an answer that would work:

I use the special Magento 2 theme, and when I made changes to the .less file, I wanted to compile the files, so I deleted the pub/static folder and deployed: php bin/magento setup:static-content:deploy. After that, no css files were 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 work in developer mode.

Does anyone have any solutions for this?

thanks

+6
source share
2 answers

I had the same problem when I did grunt refresh , I had the same errors.

To solve this problem, I deleted var/di , var/cache , var/generation , var/page_cache and the contents of the pub/static folder (be careful not to delete pub/static/.htaccess ).

Then I tried: grunt exec:themename

If it succeeds, grunt clean

If it succeeds, grunt refresh

And then setup:static-content:deploy

It worked for me.

+3
source

You need to extract the .htaccess file from the pub / static folder.

I found it here: https://github.com/magento/magento2/blob/develop/pub/static/.htaccess

* Check the version you are using magento

-one
source

All Articles