RE: SASS compile is failing in code build for our themes.

Olaf Kock, modified 2 Years ago. New Member Posts: 2 Join Date: 12/14/22 Recent Posts

Hi,

We are currently having some code build issues. It looks like SASS compile is failing in code build for our themes.


This started happening from last week, so there might be some dependency has been updated that is causing this issue.We use this command to zip the bundle and build it  

gradle clean distBundleZip --stacktrace --debug

And here are what we are seeing in the logs:

 

[15:33:46] 'build:compile-css' errored after 348 ms
4925[15:33:46] Error in plugin "sass"
4926Message:
4927    build/_css/clay/functions/_type-conversion-functions.scss
4928Error: Expected number, variable, function, or calculation.
4929   ???
493040 ???         $_: log('Invalid unit #{$unit}.');
4931   ???                 ^
4932   ???
4933  build/_css/clay/functions/_type-conversion-functions.scss 40:11  @import
4934  build/_css/clay/functions/_global-functions.scss 9:9             @import
4935  build/_css/clay/atlas.scss 5:9                                   @import
4936  build/_css/clay.scss 1:9                                         root stylesheet
4937Details:
4938    formatted: Error: Expected number, variable, function, or calculation.
4939   ???
494040 ???         $_: log('Invalid unit #{$unit}.');
4941   ???                 ^
4942   ???
4943  build/_css/clay/functions/_type-conversion-functions.scss 40:11  @import
4944  build/_css/clay/functions/_global-functions.scss 9:9             @import
4945  build/_css/clay/atlas.scss 5:9                                   @import
4946  build/_css/clay.scss 1:9                                         root stylesheet
4947    line: 40
4948    column: 11
4949    file: /codebuild/output/src2674436290/src/themes/magellan-global-theme/build/_css/clay/functions/_type-conversion-functions.scss
4950    status: 1
4951    messageFormatted: build/_css/clay/functions/_type-conversion-functions.scss
4952Error: Expected number, variable, function, or calculation.
4953   ???
495440 ???         $_: log('Invalid unit #{$unit}.');
4955   ???                 ^
4956   ???
4957  build/_css/clay/functions/_type-conversion-functions.scss 40:11  @import
4958  build/_css/clay/functions/_global-functions.scss 9:9             @import
4959  build/_css/clay/atlas.scss 5:9                                   @import
4960  build/_css/clay.scss 1:9                                         root stylesheet
4961    messageOriginal: Expected number, variable, function, or calculation.
4962   ???
496340 ???         $_: log('Invalid unit #{$unit}.');
4964   ???                 ^
4965   ???
4966  build/_css/clay/functions/_type-conversion-functions.scss 40:11  @import
4967  build/_css/clay/functions/_global-functions.scss 9:9             @import
4968  build/_css/clay/atlas.scss 5:9                                   @import
4969  build/_css/clay.scss 1:9                                         root stylesheet
4970    relativePath: build/_css/clay/functions/_type-conversion-functions.scss
4971    domainEmitter: [object Object]
4972    domainThrown: false
4973
4974[15:33:46] 'build' errored after 1.89 s
4975error Command failed with exit code 1.

 

thumbnail
Christopher Lui, modified 2 Years ago. Junior Member Posts: 39 Join Date: 3/22/10 Recent Posts

This could be due to https://liferay.atlassian.net/browse/LPS-193500. As a workaround, would you set your SASS to a version lower than 1.65.1, such as 1.64.2, in your package.json and see if that gets you past this issue?

Jamie Sammons, modified 2 Years ago. New Member Posts: 2 Join Date: 3/2/20 Recent Posts

It seems like a workaround has been documented by Liferay.

  • There is a solution in progress, but in the meantime you can use this workaround:
    1. Edit the workspace package.json in the Liferay workspace directory (liferay_workspace_dir/package.json). 
      • Important: it is not the theme's package.json.
    2. Include the "resolutions" section at the end of the JSON. It should be similar to the following:
      {
          "private": true,
          "workspaces": {
              "packages": [
                  ...
                  "themes/sample-theme"
              ]
          },
          "resolutions": {
              "sass": "1.64.2"
          }
      }
    3.  After that, you should compile the theme with no errors.
      blade gw build

 

Here's a link to their fast track article:
https://help.liferay.com/hc/en-us/articles/18614847789325