I have been working in a project with some custom code... this is our first "medium" Magento 2 project, so (as all people here I think) every day we learn new things, and we have to change the way to deal with this new Magento version
The reason for this question is asking about the command setup:di:compile
I've been using it since the first day with Magento 2, as bin/magento asks for it after every setup:upgrade
, with message "Please re-run Magento compile command"
Well... I have found executing setup:di:compile
breaks product view page in this project, with a totally ambiguous Fatal Error. I've spent whole working days trying to debug it and testing with code changes with zero result
Today, I have discovered that if I omit that command then all works like a charm, even in production mode
So, the question is... what exactly does that setup:di:compile
command? Is it required? Just recommended? Or it is some deprecated command, which is not needed to be executed?
UPDATE
As some users have required, this is the Fatal Error I was referring
PHP Fatal error: Cannot instantiate abstract class Magento\Catalog\Block\Product\View\AbstractView in ***/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93
I've searched for any custom block using Magento\Catalog\Block\Product\View\AbstractView but I've found it only in layout files, it is not present in any block class constructor
What I can't understand is: why Magento is throwing this Fatal Error with compiled code, but it works like a charm without compiled code