Answers.Body: <p>The compile fix was only backported to 5.41. If you want 5.36 you need to also require scssphp 1.6 as a workaround.</p>
  <p><a href="https://lab.civicrm.org/dev/drupal/-/issues/164" rel="nofollow noreferrer">https://lab.civicrm.org/dev/drupal/-/issues/164</a></p>
  <pre><code>composer.phar require scssphp/scssphp=1.6
  composer.phar compile
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-01T17:35:55.120Z
Answers.LastActivityDate: 2021-10-02T14:51:17.570Z
Answers.LastEditDate: 2021-10-02T14:51:17.570Z
Answers.UserDisplayName: Demerit
Body: <p>I got D9 installed, then set about installing Civi with <code>composer.phar require -W civicrm/civicrm-{core,packages,drupal-8}:'=5.36'</code> (I want to use 5.36, if possible)</p>
  <p>Things seemed to go OK except the compile stage which crashed. I ran again and chose No to compile and it looked to have installed CiviCRM. I'm able to see CiviCRM in the shortcut links, and I can sort of access some CiviCRM pages. But most of the resources are 404-ing (the ones whose URLs start with <code>/libraries/...</code>)</p>
  <p>I have done <code>drush cache-rebuild</code> and <code>cv flush</code> - no errors. I have removed <code>templates_c/en_GB</code> manually.</p>
  <p>So I thought maybe it was that broken compile step that caused the problem. I went back and ran <code>composer.phar compile</code></p>
  <blockquote>
  <p>The following packages have new compilation tasks:</p>
  <ul>
  <li>civicrm/composer-compile-lib has 1 task</li>
  <li>civicrm/civicrm-core has 1 task</li>
  </ul>
  <p>Allow these packages to compile? ([y]es, [a]lways, [n]o, [l]ist,<br />
  [h]elp) a Compiling additional files (For full details, use verbose
  &quot;-v&quot; mode.)<br />
  Compile: Generate CCL wrapper functions Compile: Greenwich<br />
  CSS (dist/bootstrap3.css) DEPRECATION WARNING: Calling built-in<br />
  functions with a non-standard name is deprecated since Scssphp 1.8.0<br />
  and will not work anymore in 2.0 (they will be treated as CSS function<br />
  calls instead). Use &quot;fade-in&quot; instead of &quot;fadein&quot;.<br />
  on line 569 of scss/_greenwich.scss</p>
  <p>Fatal error: Uncaught ScssPhp\ScssPhp\Exception\SassScriptException:<br />
  $amount: Expected 5% to be within 0% and 1% in<br />
  /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Exception/SassScriptException.php:30<br />
  Stack trace:<br />
  #0 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Node/Number.php(269):<br />
  ScssPhp\ScssPhp\Exception\SassScriptException::forArgument()<br />
  #1 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(8484):<br />
  ScssPhp\ScssPhp\Node\Number-&gt;valueInRange()<br />
  #2 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(8493):<br />
  ScssPhp\ScssPhp\Compiler-&gt;libOpacify()<br />
  #3 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(6227):<br />
  ScssPhp\ScssPhp\Compiler-&gt;libFadeIn()<br />
  #4 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(3662):<br />
  ScssPhp\ScssPhp\Compiler-&gt;callNativeFunction()<br />
  #5 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(3588):<br />
  ScssPhp\ScssPhp\Compiler-&gt;fncall()<br />
  #6 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(2928):<br />
  ScssPhp\Scss in<br />
  /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php on<br />
  line 553<br />
  @php -r 'require_once '''/var/www/d9.artfulrobot.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('''../../bower_components/select2/select2-bootstrap.css''', '''extern/select2/select2-bootstrap.scss''');'<br />
  @php -r 'require_once '''/var/www/d9.artfulrobot.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);'<br />
  Script @php -r 'require_once '''/var/www/d9.artfulrobot.uk/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</p>
  </blockquote>
  <p>I imagine &quot;Expected 5% to be within 0% and 1% in&quot; is the problem somehow.</p>
  <p>I don't believe that this is a duplicate of</p>
  <ul>
  <li><a href="https://civicrm.stackexchange.com/questions/39688/drupal-9-compilation-install-error">Drupal 9 Compilation Install Error</a> (it seems that the answer from that question has since been brought into core)</li>
  <li><a href="https://civicrm.stackexchange.com/questions/39565/drupal-8-9-compilation-install-error">Drupal 8/9 Compilation Install Error</a> (it seems that that patch has been brought in to core)</li>
  </ul>
  <p>I'm on PHP 7.4, MariaDB 10.3, nginx and docker. Composer 2.0.9. Drupal 9.2.6 The D9 site has some content brought in via a migration from D7; but I think just nodes and users. The reason I wanted 5.36 is because ultimately I want to learn how to upgrade a site from d7 to d9 and that site is on 5.36. I don't want to upgrade the d7 site to 5.39+ because there are bugs in core from 5.39 that I want to avoid ;-)</p>
  <p>Oh I seem to have fixed the missing <code>/libraries/...</code> URLs by running <code>composer.phar civicrm:publish</code>.</p>
  <p>Still interested in getting the compile working.</p>
  
Tags: <installation><drupal-9>
Title: Installing on Drupal 9 - compilation failures and resource url problems (may be related)
ThreadText: # Installing on Drupal 9 - compilation failures and resource url problems (may be related)
  
  (Asked by: username_0 on 2021-10-01)
  
  I got D9 installed, then set about installing Civi with `composer.phar require -W civicrm/civicrm-{core,packages,drupal-8}:'=5.36'` (I want to use 5.36, if possible)
  
  Things seemed to go OK except the compile stage which crashed. I ran again and chose No to compile and it looked to have installed CiviCRM. I'm able to see CiviCRM in the shortcut links, and I can sort of access some CiviCRM pages. But most of the resources are 404-ing (the ones whose URLs start with `/libraries/...`)
  
  I have done `drush cache-rebuild` and `cv flush` - no errors. I have removed `templates_c/en_GB` manually.
  
  So I thought maybe it was that broken compile step that caused the problem. I went back and ran `composer.phar compile`
  
  > The following packages have new compilation tasks:
  >
  > * civicrm/composer-compile-lib has 1 task
  > * civicrm/civicrm-core has 1 task
  >
  > Allow these packages to compile? ([y]es, [a]lways, [n]o, [l]ist,  
  > [h]elp) a Compiling additional files (For full details, use verbose
  > "-v" mode.)  
  > Compile: Generate CCL wrapper functions Compile: Greenwich  
  > CSS (dist/bootstrap3.css) DEPRECATION WARNING: Calling built-in  
  > functions with a non-standard name is deprecated since Scssphp 1.8.0  
  > and will not work anymore in 2.0 (they will be treated as CSS function  
  > calls instead). Use "fade-in" instead of "fadein".  
  > on line 569 of scss/\_greenwich.scss
  >
  > Fatal error: Uncaught ScssPhp\ScssPhp\Exception\SassScriptException:  
  > $amount: Expected 5% to be within 0% and 1% in  
  > /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Exception/SassScriptException.php:30  
  > Stack trace:  
  > #0 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Node/Number.php(269):  
  > ScssPhp\ScssPhp\Exception\SassScriptException::forArgument()  
  > #1 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php(8484):  
  > ScssPhp\ScssPhp\Node\Number->valueInRange()  
  > #2 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php(8493):  
  > ScssPhp\ScssPhp\Compiler->libOpacify()  
  > #3 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php(6227):  
  > ScssPhp\ScssPhp\Compiler->libFadeIn()  
  > #4 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php(3662):  
  > ScssPhp\ScssPhp\Compiler->callNativeFunction()  
  > #5 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php(3588):  
  > ScssPhp\ScssPhp\Compiler->fncall()  
  > #6 /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php(2928):  
  > ScssPhp\Scss in  
  > /var/www/d9.username_0.uk/vendor/scssphp/scssphp/src/Compiler.php on  
  > line 553  
  > @php -r 'require\_once '''/var/www/d9.username_0.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('''../../bower\_components/select2/select2-bootstrap.css''', '''extern/select2/select2-bootstrap.scss''');'  
  > @php -r 'require\_once '''/var/www/d9.username_0.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL\_VAR]);'  
  > Script @php -r 'require\_once '''/var/www/d9.username_0.uk/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
  
  I imagine "Expected 5% to be within 0% and 1% in" is the problem somehow.
  
  I don't believe that this is a duplicate of
  
  * [Drupal 9 Compilation Install Error](https://civicrm.stackexchange.com/questions/39688/drupal-9-compilation-install-error) (it seems that the answer from that question has since been brought into core)
  * [Drupal 8/9 Compilation Install Error](https://civicrm.stackexchange.com/questions/39565/drupal-8-9-compilation-install-error) (it seems that that patch has been brought in to core)
  
  I'm on PHP 7.4, MariaDB 10.3, nginx and docker. Composer 2.0.9. Drupal 9.2.6 The D9 site has some content brought in via a migration from D7; but I think just nodes and users. The reason I wanted 5.36 is because ultimately I want to learn how to upgrade a site from d7 to d9 and that site is on 5.36. I don't want to upgrade the d7 site to 5.39+ because there are bugs in core from 5.39 that I want to avoid ;-)
  
  Oh I seem to have fixed the missing `/libraries/...` URLs by running `composer.phar civicrm:publish`.
  
  Still interested in getting the compile working.
  
  **Tags:** installation, drupal-9
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-10-01. Score: 2 | Accepted answer
  
  The compile fix was only backported to 5.41. If you want 5.36 you need to also require scssphp 1.6 as a workaround.
  
  <https://lab.civicrm.org/dev/drupal/-/issues/164>
  
  ```
  composer.phar require scssphp/scssphp=1.6
  composer.phar compile
  
  ```
  
  
  ---
  
  