3

We have developed one Magento2 Website Version - 2.2.1, in every instance - Production, Staging and Local facing the same issue as:

Error while running php bin/magento setup:di:compile

Repositories code generation breaks every time in 14% or 1/7 instance.

Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 56.0 MiB

enter image description here

6
  • Can error log ..
    – Amit Bera
    Commented Sep 20, 2019 at 7:39
  • no error on log. Commented Sep 20, 2019 at 7:42
  • just run this and see what error you get ? php bin/magento Commented Sep 20, 2019 at 7:54
  • no error by this command Commented Sep 20, 2019 at 7:56
  • can you run with this command: php -d memory_limit=5G bin/magento setup:di:compile Commented Sep 20, 2019 at 7:58

2 Answers 2

4

Not sure if you would like it as a method but try to remove all modules in

app/code

(especially remove the modules added recently , the last time you remember the compile went fine ) .

There might be an issue on an __construct you have called on one of those modules. Add the modules one by one . Test on the local/dev site first.

After removing the modules , dont forget to do :

rm -rf var/generation/*
5
  • Okay let me try this Commented Sep 20, 2019 at 7:58
  • i have checked with disable all modules, same issue Commented Sep 20, 2019 at 8:51
  • not to disable , to remove them. Commented Sep 20, 2019 at 8:54
  • 1
    Yes, It is working now. Thanks for Valuable answer. Commented Sep 20, 2019 at 10:25
  • 1
    Im happy it worked :) Commented Sep 20, 2019 at 10:38
0

check in your code

use Magento\Tests\NamingConvention\true\string;

can break your s:d:c

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.