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

I am getting error

Compilation from source: vendor/magento/theme-frontend-blank/web/css/email-inline.less variable @baseUrl is undefined in file var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/_email-extend.less in _email-extend.less on line 19, column 13 17| // as the latter will cause font rendering issues if the web fonts are inaccessible. 18| 19| @import url("@{baseUrl}css/email-fonts.css");

Final Error

[Magento\Framework\Exception\FileSystemException] Cannot read contents from file "/pub/static/frontend/Magento/blank/en_US/css/email-inlin e.css" Warning!file_get_contents(pub/static/frontend/Magento/blank/en_US/css/email-inli ne.css): failed to open stream: No such file or directory

I followed this process

  1. Remove pub/static [Keep the .htaccess backed up and copy it again]
  2. Remove var/cache
  3. Remove var/composer_home
  4. Remove var/generation
  5. Remove var/page_cache
  6. Remove var/view_preprocessed
  7. run php bin/magento setup:static-content:deploy

But getting the same error, Dont know whats is wrong

  • It is a permission issue. Assign the right folder permissions
    – fmsthird
    Feb 23, 2019 at 0:44
  • I can also see this @baseUrl is undefined in file var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/_email-extend.less, Kindly let me know the files I have to provide permission. apart from pub and var
    – fernandus
    Feb 23, 2019 at 6:19

1 Answer 1


My lib/web folder was empty, I got them from by Backup.

When I searched for locate _email-extend.less I found the mission files.

I did penetration testing, I got some duplicate theme files in my pub/static/theme, On deleting them something wrong happened. Still dont know how this files generated.

Finally to recover I did the steps again.

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/*

sudo php bin/magento setup:upgrade;
sudo php bin/magento setup:di:compile;
sudo php bin/magento setup:static-content:deploy -f;
sudo php bin/magento indexer:reindex;
sudo php bin/magento cache:clean;
sudo php bin/magento cache:flush;
sudo chmod -R 0777 pub/;
sudo chmod -R 0777 var/;

Don't forget to Keep the .htaccess backed-up and paste them again to pub/static/

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.