2

I have a Magento 2.2.3, I get the error below after running bin/magento setup:static-content:deploy.

This error only gives me when my custom theme makes fallback in the Magento/luma theme if I make fallback to the Magento/blank theme, it works.

My custom theme has two theme.xml andregistration.php files.

#0 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/framework/App/View/Asset/Publisher.php(73): Magento\Framework\View\Asset\File->getSourceFile()
#1 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/framework/App/View/Asset/Publisher.php(61): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
#2 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Service/DeployStaticFile.php(89): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
#3 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Service/DeployPackage.php(189): Magento\Deploy\Service\DeployStaticFile->deployFile('images/select-b...', Array)
#4 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Service/DeployPackage.php(136): Magento\Deploy\Service\DeployPackage->processFile(Object(Magento\Deploy\Package\PackageFile), Object(Magento\Deploy\Package\Package))
#5 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Service/DeployPackage.php(107): Magento\Deploy\Service\DeployPackage->deployEmulated(Object(Magento\Deploy\Package\Package), Array, false)
#6 [internal function]: Magento\Deploy\Service\DeployPackage->Magento\Deploy\Service\{closure}()
#7 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/framework/App/State.php(186): call_user_func_array(Object(Closure), Array)
#8 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Service/DeployPackage.php(108): Magento\Framework\App\State->emulateAreaCode('frontend', Object(Closure))
#9 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Process/Queue.php(281): Magento\Deploy\Service\DeployPackage->deploy(Object(Magento\Deploy\Package\Package), Array)
#10 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Process/Queue.php(200): Magento\Deploy\Process\Queue->execute(Object(Magento\Deploy\Package\Package))
#11 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Process/Queue.php(162): Magento\Deploy\Process\Queue->assertAndExecute('frontend/Comaxx...', Array, Array)
#12 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Strategy/QuickDeploy.php(76): Magento\Deploy\Process\Queue->process()
#13 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/module-deploy/Service/DeployStaticContent.php(109): Magento\Deploy\Strategy\QuickDeploy->deploy(Array)
#14 /Applications/MAMP/htdocs/Projects/Magento/setup/src/Magento/Setup/Console/Command/DeployStaticContentCommand.php(140): Magento\Deploy\Service\DeployStaticContent->deploy(Array)
#15 /Applications/MAMP/htdocs/Projects/Magento/vendor/symfony/console/Command/Command.php(241): Magento\Setup\Console\Command\DeployStaticContentCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /Applications/MAMP/htdocs/Projects/Magento/vendor/symfony/console/Application.php(843): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /Applications/MAMP/htdocs/Projects/Magento/vendor/symfony/console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\DeployStaticContentCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /Applications/MAMP/htdocs/Projects/Magento/vendor/magento/framework/Console/Cli.php(104): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /Applications/MAMP/htdocs/Projects/Magento/vendor/symfony/console/Application.php(117): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /Applications/MAMP/htdocs/Projects/Magento/bin/magento(23): Symfony\Component\Console\Application->run()
#21 {main} 

2 Answers 2

0

This problem is fixed in the version of Magento 2.2.4.

It must upgrade of Magento version.

0

It's not a common problem and it's can be for different case.

The best things will be if you debug.

Suppose in my case.

vendor/magento/module-deploy/Service/DeployPackage.php

$this->deployStaticFile->deployFile()

method.

As that is on core so i did put try cache and got my solution.

For Example :

    $this->deployStaticFile->deployFile(
        $file->getFileName(),
        [
            'area' => $package->getArea(),
            'theme' => $package->getTheme(),
            'locale' => $package->getLocale(),
            'module' => $file->getModule(),
        ]
    );

code changed to

            $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test-exception.log');
            $logger = new \Zend\Log\Logger();
            $logger->addWriter($writer);
            try {
                $this->deployStaticFile->deployFile(
                    $file->getFileName(),
                    [
                        'area' => $package->getArea(),
                        'theme' => $package->getTheme(),
                        'locale' => $package->getLocale(),
                        'module' => $file->getModule(),
                    ]
                );
            }catch (\Exception $exception) {
                $logger->info("Exception FOUND");
                $logger->info($exception);
            }

Then found my exception and --

In my case there was an unexpected symlink in my code and when it try to copy the error happen.

After fixing please revert the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.