1

Magento 2.3 when deploying static content this error occurs:

Compilation from source: /var/www/html/MyProject/vendor/magento/theme-frontend-blank/web/css/styles-m.less .lib-url-check is undefined in /var/www/html/MyProject/var/view_preprocessed/pub/static/frontend/Magento/mytheme/nb_NO/css/source/lib/_icons.less in _icons.less in _module.less

And I believe due to the undefined mixin, styles-m.css is not generated as well prompting this:

The contents from the
"/var/www/html/MyProject/pub/static/frontend/Magento/mytheme/nb_NO/css/styles-m.css" file can't be read. Warning!file_get_contents(/var/www/html/MyProject/pub/static/frontend/Magento/mytheme/nb_NO/css/styles-m.css): failed to open stream: No such file or directory

pub/static has .htaccess so this is not the cause.
What else could it be, how to fix this?
My theme parent theme is blank.

UPDATE:
If anyone might get this error heres fix, in custom theme web/css/source/lib/_icons.less this code:

._lib-icon-image(
@_icon-image,
@_icon-image-width,
@_icon-image-height,
@_icon-image-margin,
@_icon-image-vertical-align,
@_icon-image-position-x,
@_icon-image-position-y
) {
.lib-url-check(@_icon-image);

.lib-css(background-image, @lib-url-check-output); // @lib-url-check-output is a returned variable of .lib-url-check() mixin
.lib-css(background-position-x, @_icon-image-position-x);
.lib-css(background-position-y, @_icon-image-position-y);
.lib-css(line-height, @_icon-image-height);
.lib-css(margin, @_icon-image-margin);
.lib-css(vertical-align, @_icon-image-vertical-align);
._lib-icon-image-size(
    @_icon-image-width,
    @_icon-image-height
);

Needs to be updated to:

._lib-icon-image-url(@_path) when not (@_path = false) {
.lib-css(background-image, url(@_path));
}

._lib-icon-image(
@_icon-image,
@_icon-image-width,
@_icon-image-height,
@_icon-image-margin,
@_icon-image-vertical-align,
@_icon-image-position-x,
@_icon-image-position-y
) {
._lib-icon-image-url(@_icon-image);
.lib-css(background-position-x, @_icon-image-position-x);
.lib-css(background-position-y, @_icon-image-position-y);
.lib-css(line-height, @_icon-image-height);
.lib-css(margin, @_icon-image-margin);
.lib-css(vertical-align, @_icon-image-vertical-align);
._lib-icon-image-size(
    @_icon-image-width,
    @_icon-image-height
);

After this static content compiles with no errors.

3

The lib-url-check mixin has been removed by the look of it, therefore you need to update your LESS files.

See this link for the commits - https://github.com/magento/magento2/search?p=1&q=lib-url-check&type=Commits

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.