1

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
asked Mar 19, 2020 at 13:07
1
  • .less file convert the .css extensions Commented Mar 19, 2020 at 13:14

3 Answers 3

2

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

answered Mar 19, 2020 at 13:32
1
  • Thanks! :) That was the problem. Commented Mar 19, 2020 at 13:51
0

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!

answered Mar 19, 2020 at 13:24
0

@block-items__counter__color and @icon-print seem not to be defined. Check if you declared these variables.

Starship
2594 silver badges11 bronze badges
answered Mar 19, 2020 at 13:24
1
  • Thanks! Well that's the strange thing, we do not define them at all in our custom theme. Commented Mar 19, 2020 at 13:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.