Magento – Magento 2.2: Custom Theme Deployment Breaks at 95%

magento2.2.2static-content-deploy

Just updated from Magento 2.1.10 to 2.2.2, and keep receiving the following when I deploy static content. Any insights on what the errors signify?

#0 /app/web/vendor/magento/framework/App/View/Asset/Publisher.php(73): Magento\Framework\View\Asset\File->getSourceFile()
#1 /app/web/vendor/magento/framework/App/View/Asset/Publisher.php(61): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
#2 /app/web/vendor/magento/module-deploy/Service/DeployStaticFile.php(89): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
#3 /app/web/vendor/magento/module-deploy/Service/DeployPackage.php(189): Magento\Deploy\Service\DeployStaticFile->deployFile('css/style.less', Array)
#4 /app/web/vendor/magento/module-deploy/Service/DeployPackage.php(136): Magento\Deploy\Service\DeployPackage->processFile(Object(Magento\Deploy\Package\PackageFile), Object(Magento\Deploy\Package\Package))
#5 /app/web/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 /app/web/vendor/magento/framework/App/State.php(186): call_user_func_array(Object(Closure), Array)
#8 /app/web/vendor/magento/module-deploy/Service/DeployPackage.php(108): Magento\Framework\App\State->emulateAreaCode('frontend', Object(Closure))
#9 /app/web/vendor/magento/module-deploy/Process/Queue.php(281): Magento\Deploy\Service\DeployPackage->deploy(Object(Magento\Deploy\Package\Package), Array)
#10 /app/web/vendor/magento/module-deploy/Process/Queue.php(200): Magento\Deploy\Process\Queue->execute(Object(Magento\Deploy\Package\Package))
#11 /app/web/vendor/magento/module-deploy/Process/Queue.php(162): Magento\Deploy\Process\Queue->assertAndExecute('frontend/CustomVendor/i...', Array, Array)
#12 /app/web/vendor/magento/module-deploy/Strategy/QuickDeploy.php(76): Magento\Deploy\Process\Queue->process()
#13 /app/web/vendor/magento/module-deploy/Service/DeployStaticContent.php(109): Magento\Deploy\Strategy\QuickDeploy->deploy(Array)
#14 /app/web/setup/src/Magento/Setup/Console/Command/DeployStaticContentCommand.php(140): Magento\Deploy\Service\DeployStaticContent->deploy(Array)
#15 /app/web/vendor/symfony/console/Command/Command.php(242): Magento\Setup\Console\Command\DeployStaticContentCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /app/web/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 /app/web/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 /app/web/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 /app/web/vendor/symfony/console/Application.php(117): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /app/web/bin/magento(23): Symfony\Component\Console\Application->run()
#21 {main}


  [Magento\Framework\Exception\FileSystemException]                                                                           
  Cannot read contents from file "/app/web/pub/static/frontend/CustomVendor/custom/en_US/css/style.min.css" Warning!file_get_con  
  tents(/app/web/pub/static/frontend/CustomVendor/custom/en_US/css/style.min.css): failed to open stream: No such file or directory 

Also, does anyone know if the js-translation.json are among the last to be deployed? They're not generated, so I'm assuming it happens at the end.

Thanks!

Best Answer

I ran into this problem with a less file that was not empty but was just full of @var definitions so it was treated as empty, which is the same thing (doesn't create a .css file to merge). The fix is to put a css definition of any kind in the file.

Also couldn't just fix it, I had to go back into developer mode, clear cache, rebuild, and then back in production the deploy:static-content would work.

Related Topic