Magento – static-content deploy error

deployerrormagento-2.0magento2static-content

running static-content:deploy on multi store-view, fails with following error variable @media-common is undefined on theme where the language en_US

Best Answer

@deroccha, I have laid out an answer to this question over here https://magento.stackexchange.com/a/152944/1956.

The long and short of it, is that @media-common isn't within the scope of your theme, in one or more .less files. We're supposed to be able to control this via use of _extend.less (which would load our custom files after var/view_preprocessed/css/frontend/<Vendor>/<theme>/<locale>/css/source/lib/_responsive.less, but for some reason that doesn't always seem to work. That being the case, you can follow the instructions in the above link as a temporary solution.

UPDATE The use of _extend.less does work as long as there isn't another configuration somewhere, like adding an implicit css call on a page configuration xml file. An example implicit css call:

<head> <css src="css/custom/theme.css" /> </head> If there is this type of entry, then there shouldn't also be an @import in the theme's _extend.less ...either or should be used.

Related Topic