D8: composer-compile-plugin fails to compile Greenwich SCSS w/ scssphp 1.7.0
I ran into an error running composer upgrade/install this morning (see below). SCSS isn't in my wheelhouse, but I saw that it wasn't happening on sites with older versions of scssphp
. Anything below 1.7 seems to work.
I could submit a PR changing the Composer requirements here, but I suspect the deeper issue is a SCSS problem that needs a SCSS person to fix.
tl;dr If you're affected by this and need an immediate fix, run composer require 'scssphp/scssphp:1.6'
.
Compile: Greenwich CSS (dist/bootstrap3.css)
> @php -r 'require_once '\''/home/jon/local/example/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('\''../../bower_components/select2/select2-bootstrap.css'\'', '\''extern/select2/select2-bootstrap.scss'\'');'
> @php -r 'require_once '\''/home/jon/local/example/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);'
PHP Fatal error: Uncaught ScssPhp\ScssPhp\Exception\SassScriptException: $amount: Expected 5% to be within 0% and 1% in /home/jon/local/example/vendor/scssphp/scssphp/src/Exception/SassScriptException.php:30
Stack trace:
#0 /home/jon/local/example/vendor/scssphp/scssphp/src/Node/Number.php(265): ScssPhp\ScssPhp\Exception\SassScriptException::forArgument('Expected 5% to ...', 'amount')
#1 /home/jon/local/example/vendor/scssphp/scssphp/src/Compiler.php(8450): ScssPhp\ScssPhp\Node\Number->valueInRange(0, 1, 'amount')
#2 /home/jon/local/example/vendor/scssphp/scssphp/src/Compiler.php(8459): ScssPhp\ScssPhp\Compiler->libOpacify(Array)
#3 /home/jon/local/example/vendor/scssphp/scssphp/src/Compiler.php(6193): ScssPhp\ScssPhp\Compiler->libFadeIn(Array, Array)
#4 /home/jon/local/example/vendor/scssphp/scssphp/src/Compiler.php(3662): ScssPhp\ScssPhp\Compiler->callNativeFunction('fadein', Array, NULL, Array)
#5 /home/jon/local/example/vendor/scssphp/scssphp/src/Compiler.php(3588): ScssPhp\ScssPhp\Compiler->fncall(Array, Array)
#6 /home/jon/local/example/vendor/scssphp in /home/jon/local/example/vendor/scssphp/scssphp/src/Compiler.php on line 553
Script @php -r 'require_once '\''/home/jon/local/example/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);' handling the shell-runner event returned with error code 255
Subcommand @composer compile returned with error code 255
[RuntimeException]
Subcommand @composer compile returned with error code 255