running static-content:deploy on multi store-view, fails with following error
variable @media-common is undefined on theme where the language en_US
@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:
<css src="css/custom/theme.css" />
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.
We found that deploying Magento 2 causes so much problems we just run in developer mode on the production site. Not a pretty solution but at least we can actually put sites live without a hundred errors.
Until the errors and the process is resolved by the core team we'll be using this solution. The github issue is more than a year old now. There is not even an official guide for deployment:
In my case the issue was caused by first letter in my custom styles file name. File name should start from underscore, it provides proper files merging queue. For instance,file with name product.less
caused error during static content deploy @media-common is undefined. Adding the underscore at the beginning of name resolved issue.