How to fix incompatible issue on M2.3.6 and M2.4.0?

Created by Rosa Truong, Modified on Thu, 10 Dec, 2020 at 11:20 AM by Jane D

Issue: 

I am trying to upgrade two completely separate websites to Magento 2.3.6. I have performed the upgrades but upon running setup:di:compile I am getting the following error

Errors during compilation:

        Bss\CheckoutCustomField\Model\Plugin\Sales\Order\Pdf\Creditmemo

                Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File:

/chroot/home/magetwo/mage2.energyconservatory.com/html/vendor/bsscommerce/checkoutcustomfield/Model/Plugin/Sales/Order/Pdf/Creditmemo.php

       Bss\CheckoutCustomField\Model\Plugin\Sales\Order\Pdf\Invoice

                Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File:

/chroot/home/magetwo/mage2.energyconservatory.com/html/vendor/bsscommerce/checkoutcustomfield/Model/Plugin/Sales/Order/Pdf/Invoice.php

        Bss\CheckoutCustomField\Model\Plugin\Sales\Order\Pdf\Shipment

                Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File:

/chroot/home/magetwo/mage2.energyconservatory.com/html/vendor/bsscommerce/checkoutcustomfield/Model/Plugin/Sales/Order/Pdf/Shipment.php

Total Errors Count: 3

In Log.php line 92:

  Error during compilation

setup:di:compile


Solution:

The issue is caused due to our module's bug when the class __construct is not compatible with Magento 2.3.6 (as well as Magento 2.4.0) at this time. 

To solve the issue, we have changed these files
app/code/Bss/CheckoutCustomField/Model/Plugin/Sales/Order/Pdf/Creditmemo.php
app/code/Bss/CheckoutCustomField/Model/Plugin/Sales/Order/Pdf/Invoice.php
app/code/Bss/CheckoutCustomField/Model/Plugin/Sales/Order/Pdf/Shipment.php

Please check and apply the attachment files on your site.


If you need any further support, please feel free to contact us.

We are always willing to help you.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article