Backtrace the error
Add the following code in /vendor/magento/framework/View/Asset/PreProcessor/FileNameResolver.php
above line 45
if ($fileName === null) {
debug_print_backtrace(2);
die;
}
For me, the backtrace output was something like this:
#0 vendor/magento/module-deploy/Collector/Collector.php(97): Magento\Framework\View\Asset\PreProcessor\FileNameResolver->resolve(NULL)
#1 vendor/magento/module-deploy/Package/PackagePool.php(183): Magento\Deploy\Collector\Collector->collect()
#2 vendor/magento/module-deploy/Package/PackagePool.php(117): Magento\Deploy\Package\PackagePool->collect()
#3 vendor/magento/module-deploy/Strategy/QuickDeploy.php(54): Magento\Deploy\Package\PackagePool->getPackagesForDeployment(Array)
I had to create the following patch to fix the error:
--- a/vendor/magento/module-deploy/Collector/Collector.php
+++ b/vendor/magento/module-deploy/Collector/Collector.php
@@ -90,7 +90,7 @@
foreach ($this->sourcePool->getAll() as $source) {
$files = $source->get();
foreach ($files as $file) {
- if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule())) {
+ if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule()) || is_null($file->getFileName())) {
continue;
}
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));