I got this error when running setup:static-content:deploy on Magento 2.1.8:
Compilation from source: /microcloud/domains/vampm2/domains/mydomains.co.uk/http/vendor/magento/theme-frontend-blank/web/css/styles-m.less
Compilation from source:
frontend/Venustheme/cricket_child/en_GB/css/styles-m.less
variable @checkout-step-content-mobile__background is undefined in file /microcloud/domains/vampm2/domains/mydomain.co.uk/http/var/view_preprocessed/css/frontend/Venustheme/cricket_child/en_GB/Magento_Checkout/css/source/module/checkout/_shipping.less in _shipping.less on line 213, column 34
211| .form-shipping-address,
212| .methods-shipping {
213| .lib-css(background, @checkout-step-content-mobile__background);
214| .lib-css(margin, @checkout-step-content-mobile__margin);
215| .lib-css(padding, @indent__base @checkout-step-content-mobile__margin-s);
in _responsive.less
This is a .less file form /vampm2/domains/mydomian.co.uk/http/app/design/frontend/Venustheme/cricket_child/Magento_Checkout/web/css/source/module/checkout/_shipping.less:
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
.opc-wrapper {
.form-login,
.form-shipping-address,
.methods-shipping {
.lib-css(background, @checkout-step-content-mobile__background);
.lib-css(margin, @checkout-step-content-mobile__margin);
.lib-css(padding, @indent__base @checkout-step-content-mobile__margin-s);
}
UPDATE The variable is not defined within this file. There are variables defined at the top of this page but checkout-step-content-mobile__background is not. From comments below, the checkout-step-content-mobile__background variable is defined in the _checkout.less file and I have found the declaration only in the http\vendor\magento\theme-frontend-luma\Magento_Checkout\web\css\source\module\checkout\_checkout.less but from what the system.log say's, it's trying to pull it from theme-frontend-blank:
[2017年12月14日 12:24:08] main.CRITICAL: Compilation from source: /microcloud/domains/vampm2/domains/operationvape.co.uk/http/vendor/magento/theme-frontend-blank/web/css/styles-m.less
UPDATE
Here is the error from my system.log:
[2017年12月14日 12:24:08] main.CRITICAL:
Compilation from source:
frontend/Venustheme/cricket_child/en_US/css/styles-m.less
variable @checkout-step-content-mobile__background is undefined in file /microcloud/domains/vampm2/domains/operationvape.co.uk/http/var/view_preprocessed/css/frontend/Venustheme/cricket_child/en_US/Magento_Checkout/css/source/module/checkout/_shipping.less in _shipping.less on line 213, column 34
211| .form-shipping-address,
212| .methods-shipping {
213| .lib-css(background, @checkout-step-content-mobile__background);
214| .lib-css(margin, @checkout-step-content-mobile__margin);
215| .lib-css(padding, @indent__base @checkout-step-content-mobile__margin-s);
216| }
in _responsive.less [] []
[2017年12月14日 12:24:08] main.CRITICAL: Compilation from source: /microcloud/domains/vampm2/domains/operationvape.co.uk/http/vendor/magento/theme-frontend-blank/web/css/styles-m.less
2 Answers 2
Are you using Linux os please use this command to deploy the content go to your root folder of your project and give this command in your terminal:
sudo chmod -R 777 var && sudo chmod -R 777 pub && sudo chmod -R 777 generated && sudo php -f bin/magento setup:upgrade && sudo chmod -R 777 var && sudo chmod -R 777 pub && sudo chmod -R 777 generated && php bin/magento setup:static-content:deploy -f && sudo chmod -R 777 var && sudo chmod -R 777 pub && sudo chmod -R 777 generated
-
777 permissions are not the best idea, see correct persmissions from Magento documentationTero Lahtinen– Tero Lahtinen2019年04月05日 08:00:45 +00:00Commented Apr 5, 2019 at 8:00
Looking back at the answer from @Suresh R, it's not ideal to set the permissions to 777.
Magento recommends all directories to have 770 permissions and all files have 660 permissions.
To achieve the following run the command:
cd <your Magento install dir>
find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 permission for directory
find ./var -type d -exec chmod 777 {} \; // 777 permission for var folder
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :<web server group> .
chmod u+x bin/magento
Explore related questions
See similar questions with these tags.
@checkout-step-content-mobile__backgroundis defined and has a value assigned to it._shipping.lessfile. There is novars.lessorvariables.lessfiles in the same directory or anywhere within theMagento_Checkoutdirectory :/@checkout-step-content-mobile__background: #ffffff;and replace theffffffstring with a color of your choice.