When I run php bin/magento setup:static-content:deploy
I have had some errors in my theme. I have got to the bottom of them but it was a pain, I had to manually go through all my LESS files to check for errors.
The culprit was an import that was missing an underscore.
I checked var/log/debug.log
and var/log/support_report.log
but these don't seem to log LESS errors. Client side compilation doesn't either, this just returned a 404 for styles-l.css and styles-m.css as the deployment must have failed before it reached these files.
TL:DR
Now my question is, are the static content deploy errors logged anywhere? It would have been so much easier if there was a log along the lines of x.less can not be imported
.
This is Magento 2.0.4 with a custom theme using Luma as a parent.
Example of my error:
=== frontend -> ThemeName/default -> en_GB ===
...
Successful: 2248 files; errors: 1
---
Best Answer
I reckon there's several types of errors that can be triggered by the deployment.
First you can see that Exception are handled directly in the execution in
Magento/Deploy/Console/Command/DeployStaticContentCommand.php
:Regarding the errors that are counted it's a totally different system, you need to look into the
Magento/Deploy/Model/Deployer
class, the output you got is written by thedeploy()
method:Now if we check when this
errorCount
variable is incremented, we find the following in thedeployFile()
method:And as you may have already guessed, the
verboseLog()
method only outputs when the command is run on verbose mode:So I reckon you need to run your command like this to see the errors:
If it doesn't work try the extra verboses: