-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
In lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php:88
if (trim($content) === '') {
$errorMessage = PHP_EOL . self::ERROR_MESSAGE_PREFIX . PHP_EOL . $path;
$this->logger->critical($errorMessage);
throw new ContentProcessorException(new Phrase($errorMessage));
}
... the less processor checks if a file was compiled successfully by checking if the content is not an empty string.
If you include the less version of Twitter-Bootstrap into a theme or extenion the build process fails because of that.
explanation:
Magento tries to build all of the file separately. When it comes across a mixin file the result will be empty because all mixins are resolved to an empty string by the less parser. See vendor/oyejorge/less.php/lib/Less/Visitor/toCSS.php:31
public function visitMixinDefinition($mixinNode){
// mixin definitions do not get eval'd - this means they keep state
// so we have to clear that state here so it isn't used if toCSS is called twice
$mixinNode->frames = array();
return array();
}
workaround:
A temporary workaround is to add a bogus CSS definition into mixin files like:
#bogus { display: none }
possible solution:
Empty results of less-files should not be treated as an error. A warning would surely suffice. I can propose a PR if this is a valid solution.