When there are errors in a Less file they can be difficult to debug as the trace makes little sense, at least not to a front-end dev.
For example I have imported Bootstrap into my theme, one of the (approx 80!) files are causing an error but I'm struggling to track it down. The front-end loads fine and there is no evidence of any errors, also client-side compilation returns no errors. Yet when I try run php bin/magento setup:static-content:deploy
it says there is an error in my theme.
The only helpful bit of the trace is the code below as I can see css/vendor/boot
, if I had multiple directories beginning with boot
I'd be clueless.
#14 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/module-deploy/Model/Deployer.php(172): Magento\Deploy\Model\Deployer->deployFile('css/vendor/boot...', 'frontend', 'PartyShowroom/d...', 'en_US', '')
I'd expect the error to mention the file path, file name, and line causing the error. And the actual error itself. Something along the lines of:
Error: @variable-x is not defined
File: app/design/frontend/PartyShowroom/default/web/css/vendor/bootstrap/_badges.less
Line 92
Without this I'm left with an error that could be in 1 of approx 80 files.
0 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/Filesystem/Directory/Write.php(146): Magento\Framework\Filesystem\Directory\Write->assertIsFile('')
#1 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/App/View/Asset/MaterializationStrategy/Symlink.php(30): Magento\Framework\Filesystem\Directory\Write->createSymlink('', 'frontend/PartyS...', Object(Magento\Framework\Filesystem\Directory\Write))
#2 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/App/View/Asset/Publisher.php(66): Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink->publishFile(Object(Magento\Framework\Filesystem\Directory\Write), Object(Magento\Framework\Filesystem\Directory\Write), '', 'frontend/PartyS...')
#3 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/App/View/Asset/Publisher.php(50): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
#4 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/module-developer/Model/Css/PreProcessor/FileGenerator/PublicationDecorator.php(72): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
#5 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/Css/PreProcessor/FileGenerator/RelatedGenerator.php(62): Magento\Developer\Model\Css\PreProcessor\FileGenerator\PublicationDecorator->generateRelatedFile('variables.less', Object(Magento\Framework\View\Asset\File))
#6 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/Css/PreProcessor/Instruction/Import.php(69): Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator->generate(Object(Magento\Framework\Css\PreProcessor\Instruction\Import))
#7 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/View/Asset/PreProcessor/Pool.php(74): Magento\Framework\Css\PreProcessor\Instruction\Import->process(Object(Magento\Framework\View\Asset\PreProcessor\Chain))
#8 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/View/Asset/Source.php(128): Magento\Framework\View\Asset\PreProcessor\Pool->process(Object(Magento\Framework\View\Asset\PreProcessor\Chain))
#9 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/View/Asset/Source.php(86): Magento\Framework\View\Asset\Source->preProcess(Object(Magento\Framework\View\Asset\File))
#10 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/View/Asset/File.php(150): Magento\Framework\View\Asset\Source->getFile(Object(Magento\Framework\View\Asset\File))
#11 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/App/View/Asset/Publisher.php(63): Magento\Framework\View\Asset\File->getSourceFile()
#12 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/App/View/Asset/Publisher.php(50): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
#13 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/module-deploy/Model/Deployer.php(340): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
#14 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/module-deploy/Model/Deployer.php(172): Magento\Deploy\Model\Deployer->deployFile('css/vendor/boot...', 'frontend', 'PartyShowroom/d...', 'en_US', '')
#15 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/module-deploy/Console/Command/DeployStaticContentCommand.php(120): Magento\Deploy\Model\Deployer->deploy(Object(Magento\Framework\App\ObjectManagerFactory), Array)
#16 /var/www/vhosts/partyshowroom/production/htdocs/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Magento\Deploy\Console\Command\DeployStaticContentCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/vhosts/partyshowroom/production/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/vhosts/partyshowroom/production/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Deploy\Console\Command\DeployStaticContentCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/vhosts/partyshowroom/production/htdocs/vendor/magento/framework/Console/Cli.php(49): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/vhosts/partyshowroom/production/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/vhosts/partyshowroom/production/htdocs/bin/magento(25): Symfony\Component\Console\Application->run()
#22 {main}
Internal issue: MAGETWO-52800
Implemented. Internal issue: MAGETWO-52800
What commit was this implemented in?
Most helpful comment
Implemented. Internal issue: MAGETWO-52800