-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Di:Compile - Compiled Codes Di has wrong Instances of Arguments for Construct #5954
Comments
Same thing with Plugin interceptor - Something must be going wrong during the DI:compile that is not being logged! |
@antbates1991 could you please paste full class content here. I tried to reproduce and got an error on compilation. |
|
The same error. I renamed the file to Linkz.php and the class accordingly.
Do you have the same result on the latest CE? |
Sorry I completely forgot we have created a module on our installations so that the compiler works with php 7 return types. If you remove all php 7 return types from the class you will find it should compile. |
Removed ": bool" for isLoggedIn() and got the same result: compilation fails. Am I doing anything wrong? |
No that should work fine. |
@antbates1991 I deployed Magento CE 2.1.0 from git tag and applied these changes(patch) |
@SerhiyShkolyarenko I have updated to Magento EE 2.1.1 and that has resolved this issue. The Di Compile now works correctly. |
@antbates1991 If you are a developer for a merchant or a partner, please use the Support or Partner portal to file issues. Github does not have account level tracking for issues though we are responding to issues here but without any SLA. |
@antbates1991 Seems that issues is no longer actual. Closing. Reopen if needed |
I am experiencing a similar issue:
Magento Version: 2.1.2 Here is my Controller: ` use Magento\Framework\App\Action\Context; class Version extends \MyModule\Service\Controller\Module {
} Everything works when I clear /di and /generation folders buy breaks again when I run
|
I am also having same issue with Magento 2.1.2 PHP Version 7.0.4. The code works fine without compilation but gives error after running compilation. Fatal error: Uncaught TypeError: Argument 1 passed to Ktpl\Customergroups\Model\Plugin\CustomerExtractor::__construct() must be an instance of Magento\Customer\Model\Metadata\FormFactory, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /var/www/webroot/beta.magedelight.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/webroot/beta.magedelight.com/app/code/Ktpl/CustomerGroups/Model/Plugin/CustomerExtractor.php:50 Stack trace: #0 /var/www/webroot/beta.magedelight.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Ktpl\Customergroups\Model\Plugin\CustomerExtractor->__construct(Object(Magento\Framework\ObjectManager\ObjectManager)) #1 /var/www/webroot/beta.magedelight.com/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Ktpl\CustomerGr...', Array) #2 /var/www/webroot/beta.magedelight.com/vendor/magento/framework/ObjectManager/Factory in /var/www/webroot/beta.magedelight.com/app/code/Ktpl/CustomerGroups/Model/Plugin/CustomerExtractor.php on line 50 My custom model class code is `<?php use Magento\Framework\Event\ObserverInterface; class CustomerExtractor extends \Magento\Customer\Model\CustomerExtractor
} |
Same Issue: Magento 2.1.5 CE Then I ran: Fatal error: Uncaught Error: Class 'Cli' not found in /Applications/MAMP/htdocs/MagentoCE/bin/magento:31 Then I deleted the Cache folder contents aswell and di:compile completed. All working after that. |
Preconditions
Steps to reproduce
Magento\Framework\View\Element\Html\Links
Where the types are defined at the top of the file as:
di:compile
.I have a attached a screenshot of the arguments being passed into the create function for
Magento\Framework\ObjectManager\Factory\Compiled
.Expected result
Actual result
Delete the var/di directory and the file works fine, recompile again and it breaks. This happens on a local dev environment, and a production dev/staging environment.
The text was updated successfully, but these errors were encountered: