I'm running multiple websites and they all produce this error when I clear all cache (this is a Windows server):
PHP Fatal error: Uncaught Error: Call to a member function scanDirectory() on null in C:\******\web\core\lib\Drupal\Core\Asset\CssCollectionOptimizer.php:200
Stack trace:
#0 C:\******\web\modules\contrib\wincachedrupal\src\Asset\CssCollectionOptimizer.php(53): Drupal\Core\Asset\CssCollectionOptimizer->deleteAll()
#1 C:\******\web\core\includes\common.inc(1039): Drupal\wincachedrupal\Asset\CssCollectionOptimizer->deleteAll()
#2 C:\******\web\core\includes\utility.inc(55): drupal_flush_all_caches()
#3 C:\******\vendor\drush\drush\src\Commands\core\CacheCommands.php(204): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request))
#4 [internal function]: Drush\Commands\core\CacheCommands->rebuild(Array)
#5 C:\******\vendor\consolidation\annotated-command\src\CommandProcessor.php(257): call_user_func_array(Array, Array)
#6 C:\******\vendor\consolidation\annotated-command\src\C in C:\******\web\core\lib\Drupal\Core\Asset\CssCollectionOptimizer.php on line 200
If anyone could point me in the right direction, that's be great.
My specs:
Drupal 8.8.2
Windows 10
PHP 7.2.25
composer 1.9.3
drush 9
Comments
Comment #2
Dudelinos commentedComment #3
longwaveLooks like this might be triggered by the "wincachedrupal" module, https://www.drupal.org/project/wincachedrupal ?
Comment #4
avpadernoComment #5
Dudelinos commentedAre you implying updating to the dev version will solves this? I'm not sure I'm comfortable to do that on a production environment.
Comment #6
avpadernoThe bug will be fixed in 8.8.x (the Git branch) and later a new release will created. In bug reports, as well as in feature requests and tasks, the issue version is a development snapshot version such as 8.8.x-dev.
Comment #7
Dudelinos commentedComment #8
Dudelinos commentedComment #9
Dudelinos commentedOk Thanks, I'll wait for the stable release then. The error doesn't stop me from clearing the cache, even if it's annoying.
Comment #10
Dudelinos commentedOk, I have updated core to 8.8.3 and the issue is still there. At this point, I'm contemplating rebuilding the entire website out of frustration.
Comment #11
rajeevgoleI am also facing the same issues.
Drupal 8.8.5
Drupal 7.3
Comment #12
bluegeek9 commentedWhat are the steps to reproduce this bug? Just clear the cache?
It sounds very similair to #2854825: Deprecated function: drupal_realpath. CssCollectionOptimizer and JsCollectionOptimizer were not implementing inheritance correctly, they did not implement a FileSystemInterface. The latest dev release contains the fix.