Closed lagunacellar closed 2 years ago
The culprit: /var/www/beta/vendor/magento/framework/View/Asset/PreProcessor/FileNameResolver.php
The solution: ???
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\View\Asset\PreProcessor;
/**
* Class FileNameResolver
*
* @package Magento\Framework\View\Asset\PreProcessor
*/
class FileNameResolver
{
/**
* @var AlternativeSource[]
*/
private $alternativeSources;
/**
* FileNameResolver constructor.
* @param array $alternativeSources
* @internal param AlternativeSource $alternativeSource
*/
public function __construct(array $alternativeSources = [])
{
$this->alternativeSources = array_map(
function (AlternativeSourceInterface $alternativeSource) {
return $alternativeSource;
},
$alternativeSources
);
}
/**
* Resolve filename
*
* @param string $fileName
* @return string
*/
public function resolve($fileName)
{
$compiledFile = $fileName;
$extension = pathinfo($fileName, PATHINFO_EXTENSION);
foreach ($this->alternativeSources as $name => $alternative) {
if ($alternative->isExtensionSupported($extension)
&& strpos(basename($fileName), '_') !== 0
) {
$compiledFile = substr($fileName, 0, strlen($fileName) - strlen($extension) - 1);
$compiledFile = $compiledFile . '.' . $name;
}
}
return $compiledFile;
}
}
When installing Magento Cloud 2.4.4 on local server, ran into this error when running $ bin/magento setup:static-content:deploy -f
Deploy using quick strategy Error happened during deploy process: Deprecated Functionality: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/beta/vendor/magento/framework/View/Asset/PreProcessor/FileNameResolver.php on line 44
When installing 2.4.4 on Magento Cloud, ran into a related error:
E: Error building project: Step failed with status code 19.
E: Error: Unable to build application, aborting.