Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-103169

Cannot build a theme created with blade: Sass::SyntaxError: Invalid CSS after "...nput-margin-x: ":

    Details

    • Branch Version/s:
      7.2.x, 7.1.x, 7.0.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      4

      Description

      This issue is reproduced with version 3.0.1 of com.liferay.css.builder module, that was commited in LPS-103051

       

      Steps to reproduce

      1. Create a theme using blade:
        blade create -t theme mytheme -v 7.1
      2. Go to theme folder:
        cd mytheme
      3. Build theme:
        blade gw build
        • Expected behavior: theme is correctly built
        • Wrong behavior: following error is thrown
          C:\Temp\blade71\mytheme> blade gw build
          
          > Task :buildCSS
          Using Ruby Sass compiler
          Sass::SyntaxError: Invalid CSS after "...nput-margin-x: ": expected expression (e.g. 1px, bold), was "!default;"
                    expected at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:1207
                   expected! at uri:classloader:/gems/sass-3.4.25/lib/sass/script/lexer.rb:229
                 assert_expr at uri:classloader:/gems/sass-3.4.25/lib/sass/script/parser.rb:710
                       parse at uri:classloader:/gems/sass-3.4.25/lib/sass/script/parser.rb:75
                 sass_script at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:1063
                    variable at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:630
                 block_child at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:684
              block_contents at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:677
                  stylesheet at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:125
                       parse at uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:41
                    _to_tree at uri:classloader:/gems/sass-3.4.25/lib/sass/engine.rb:409
                     to_tree at uri:classloader:/gems/sass-3.4.25/lib/sass/engine.rb:315
                visit_import at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:327
                 with_import at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88
                  with_frame at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115
                 with_import at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88
                visit_import at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:326
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162
                   with_base at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79
                  with_frame at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115
                   with_base at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162
                visit_import at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:329
                         map at org/jruby/RubyArray.java:2577
                visit_import at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:329
                 with_import at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88
                  with_frame at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115
                 with_import at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88
                visit_import at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:326
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162
                   with_base at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79
                  with_frame at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115
                   with_base at uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162
              visit_children at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:52
                         map at org/jruby/RubyArray.java:2577
              visit_children at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:52
              visit_children at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:171
            with_environment at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:183
              visit_children at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:170
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36
                  visit_root at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:190
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:161
                       visit at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:10
                    css_tree at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/root_node.rb:36
                      render at uri:classloader:/gems/sass-3.4.25/lib/sass/tree/root_node.rb:20
                      render at uri:classloader:/gems/sass-3.4.25/lib/sass/engine.rb:284
                     process at <script>:61
          Exception in thread "main" com.liferay.sass.compiler.ruby.internal.RubySassCompilerException: Unable to parse C:\Temp\blade71\mytheme\build\buildTheme\css\clay.scss
                  at com.liferay.sass.compiler.ruby.internal.RubySassCompiler.compileFile(RubySassCompiler.java:175)
                  at com.liferay.css.builder.CSSBuilder._parseSass(CSSBuilder.java:382)
                  at com.liferay.css.builder.CSSBuilder._parseSassFile(CSSBuilder.java:394)
                  at com.liferay.css.builder.CSSBuilder.execute(CSSBuilder.java:166)
                  at com.liferay.css.builder.CSSBuilder.main(CSSBuilder.java:80)
          Caused by: org.jruby.embed.InvokeFailedException: (SyntaxError) Invalid CSS after "...nput-margin-x: ": expected expression (e.g. 1px, bold), was "!default;"
                  at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.call(EmbedRubyObjectAdapterImpl.java:320)
                  at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.callMethod(EmbedRubyObjectAdapterImpl.java:170)
                  at org.jruby.embed.ScriptingContainer.callMethod(ScriptingContainer.java:1463)
                  at com.liferay.sass.compiler.ruby.internal.RubySassCompiler.compileFile(RubySassCompiler.java:154)
                  ... 4 more
          Caused by: org.jruby.exceptions.StandardError: (SyntaxError) Invalid CSS after "...nput-margin-x: ": expected expression (e.g. 1px, bold), was "!default;"
                  at RUBY.expected(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:1207)
                  at RUBY.expected!(uri:classloader:/gems/sass-3.4.25/lib/sass/script/lexer.rb:229)
                  at RUBY.assert_expr(uri:classloader:/gems/sass-3.4.25/lib/sass/script/parser.rb:710)
                  at RUBY.parse(uri:classloader:/gems/sass-3.4.25/lib/sass/script/parser.rb:75)
                  at RUBY.sass_script(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:1063)
                  at RUBY.variable(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:630)
                  at RUBY.block_child(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:684)
                  at RUBY.block_contents(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:677)
                  at RUBY.stylesheet(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:125)
                  at RUBY.parse(uri:classloader:/gems/sass-3.4.25/lib/sass/scss/parser.rb:41)
                  at RUBY._to_tree(uri:classloader:/gems/sass-3.4.25/lib/sass/engine.rb:409)
                  at RUBY.to_tree(uri:classloader:/gems/sass-3.4.25/lib/sass/engine.rb:315)
                  at RUBY.visit_import(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:327)
                  at RUBY.with_import(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88)
                  at RUBY.with_frame(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115)
                  at RUBY.with_import(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88)
                  at RUBY.visit_import(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:326)
                  at uri_3a_classloader_3a_.gems.sass_minus_3_dot_4_dot_25.lib.sass.tree.visitors.base.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162)
                  at RUBY.with_base(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79)
                  at RUBY.with_frame(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115)
                  at RUBY.with_base(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162)
                  at RUBY.visit_import(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:329)
                  at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2577)
                  at RUBY.visit_import(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:329)
                  at RUBY.with_import(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88)
                  at RUBY.with_frame(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115)
                  at RUBY.with_import(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:88)
                  at RUBY.visit_import(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:326)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162)
                  at RUBY.with_base(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79)
                  at RUBY.with_frame(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:115)
                  at RUBY.with_base(uri:classloader:/gems/sass-3.4.25/lib/sass/stack.rb:79)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:162)
                  at RUBY.visit_children(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:52)
                  at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2577)
                  at RUBY.visit_children(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:52)
                  at RUBY.visit_children(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:171)
                  at RUBY.with_environment(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:183)
                  at RUBY.visit_children(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:170)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36)
                  at RUBY.visit_root(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:190)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb:36)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:161)
                  at RUBY.visit(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb:10)
                  at RUBY.css_tree(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/root_node.rb:36)
                  at RUBY.render(uri:classloader:/gems/sass-3.4.25/lib/sass/tree/root_node.rb:20)
                  at RUBY.render(uri:classloader:/gems/sass-3.4.25/lib/sass/engine.rb:284)
                  at RUBY.process(<script>:61)
          
          > Task :buildCSS FAILED
          
          FAILURE: Build failed with an exception.
          
          * What went wrong:
          Execution failed for task ':buildCSS'.
          > Process 'command 'C:\Program Files\Java\jdk1.8.0_211\bin\java.exe'' finished with non-zero exit value 1
          
          * Try:
          Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
          
          * Get more help at https://help.gradle.org
          
          BUILD FAILED in 7s
          2 actionable tasks: 1 executed, 1 up-to-date

       

      Workaround
      As a workaround, adding following line to build.gradle, avoids the issue:

      cssBuilder group: "com.liferay", name: "com.liferay.css.builder", version: "3.0.0"

      That line must be added in dependencies section, for example, after themeBuilder line.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lawrence.lee Lawrence Lee
                Reporter:
                jorge.diaz Jorge Diaz
                Participants of an Issue:
                Recent user:
                Lawrence Lee
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  17 weeks, 4 days ago

                  Packages

                  Version Package
                  7.0.X
                  7.1.X
                  7.2.X
                  7.2.1 CE GA2
                  Master