QuestionQ21
VerifiedTroubleshoot to identify the root cause of issues with Adobe CommerceWhile building new website functionality in developer mode with every cache type enabled, an Adobe Commerce Developer must add \Magento\Sales\Model\Service\InvoiceService $invoiceService as a new dependency to an existing page-action controller in Vendor\CustomModule\Controller\Index\Index. This is done as follows:

After cleaning the full_page cache and refreshing the page, the developer receives this exception:
Recoverable Error: Argument 2 passed to Vendor\CustomModule\Controller\Index\Index::__construct() must be an instance of \Magento\Sales\Model\Service\InvoiceService [...]
What action should the Architect recommend to resolve this error?
Community Discussion