Question

I face the following error when I run a static-content:deploy, but I can not find the problem.

In our custom theme we do not have a _extends.less file. So I can not find the problem, why it is showing the error of the default frontend Blank theme.

Any idea how to solve this issue?

ERROR:

frontend/Magento/blank/en_US            2476/2476           ============================ 100%   2 secs              
adminhtml/Magento/backend/en_US         2682/2682           ============================ 100%   3 secs              
frontend/Magento/luma/en_US             2493/2493           ============================ 100%   2 secs              
frontend/MyTheme/mytheme/en_US          2396/2567           ==========================>- 93%    3 secs
Compilation from source: /vendor/magento/theme-frontend-blank/web/css/styles-l.less
variable @icon-print is undefined in file /var/view_preprocessed/pub/static/frontend/MyTheme/mytheme/en_US/css/source/_extends.less in _extends.less on line 1105, column 5
1103| @abs-action-print: {
1104|     .lib-icon-font(
1105|     @icon-print,
frontend/Magento/blank/en_US            2476/2476           ============================ 100%   2 secs              
adminhtml/Magento/backend/en_US         2682/2682           ============================ 100%   3 secs              
frontend/Magento/luma/en_US             2493/2493           ============================ 100%   2 secs              
frontend/MyTheme/mytheme/en_US          2397/2567           ==========================>- 93%    4 secs
Compilation from source: /vendor/magento/theme-frontend-blank/web/css/styles-m.less
variable @block-items__counter__color is undefined in file /var/view_preprocessed/pub/static/frontend/MyTheme/mytheme/en_US/css/source/_extends.less in _extends.less on line 1533, column 25
1531| & when (@media-common = true) {
1532|     .abs-block-items-counter {
1533|         .lib-css(color, @block-items__counter__color);
frontend/Magento/blank/en_US            2476/2476           ============================ 100%   2 secs              
adminhtml/Magento/backend/en_US         2682/2682           ============================ 100%   3 secs              
frontend/Magento/luma/en_US             2493/2493           ============================ 100%   2 secs              
frontend/MyTheme/mytheme/en_US          2567/2567           ============================ 100%   4 secs              
frontend/MyTheme/mobile/en_US           2396/2567           ==========================>- 93%    3 secs
Compilation from source: /vendor/magento/theme-frontend-blank/web/css/styles-l.less
variable @icon-print is undefined in file /var/view_preprocessed/pub/static/frontend/MyTheme/mobile/en_US/css/source/_extends.less in _extends.less on line 1105, column 5
1103| @abs-action-print: {
1104|     .lib-icon-font(
frontend/Magento/blank/en_US            2476/2476           ============================ 100%   2 secs              
adminhtml/Magento/backend/en_US         2682/2682           ============================ 100%   3 secs              
frontend/Magento/luma/en_US             2493/2493           ============================ 100%   2 secs              
frontend/MyTheme/mytheme/en_US          2567/2567           ============================ 100%   4 secs              
frontend/MyTheme/mobile/en_US           2397/2567           ==========================>- 93%    4 secs
Compilation from source: /vendor/magento/theme-frontend-blank/web/css/styles-m.less
variable @block-items__counter__color is undefined in file /var/view_preprocessed/pub/static/frontend/MyTheme/mobile/en_US/css/source/_extends.less in _extends.less on line 1533, column 25
1531| & when (@media-common = true) {
1532|     .abs-block-items-counter {
frontend/Magento/blank/en_US            2476/2476           ============================ 100%   2 secs              
adminhtml/Magento/backend/en_US         2682/2682           ============================ 100%   3 secs              
frontend/Magento/luma/en_US             2493/2493           ============================ 100%   2 secs              
frontend/MyTheme/mytheme/en_US          2567/2567           ============================ 100%   4 secs              
frontend/MyTheme/mobile/en_US           2567/2567           ============================ 100%   4 secs
Was it helpful?

Solution

You are using an undefined variable in one of your less files the error clearly states it. pub/static files are generated from module and theme files (where the error is introduced). removing files from pub/static won't do you any good. You have to find your less file in your modules or theme and remove the line of code that uses an undefined variable. You also have to remove var/view_preprocessed (also written in the error message)

Update: @block-items__counter__color and @icon-print is need to defined at your variable.less or _extends.less files at your theme folder.

After that, you need to do static content deploy

OTHER TIPS

Please check the solution

https://github.com/magento/magento2/issues/8377

@shinesoftware I have solved deleting the _module.less created in my own theme. After the compilation, Magento works like a charm!

@block-items__counter__color and @icon-print seems to be not defined, where did you declare this variables?

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top