I'm getting this error when running php -f bin/magento setup:di:compile

Warning: Narrowing occurred during type inference

Does anyone know how to fix it?

php -f bin/magento setup:di:compile -vvv Compilation was started. Proxies code generation... 0/7 [>---------------------------] 0% < 1 sec 34.0 Proxies code generation... 1/7 [====>-----------------------] 14% 1 sec 36.0 MiRepositories code generation... 1/7 [====>-----------------------] 14% 1 sec 36.0 MiB

[Exception] Warning: Narrowing occurred during type inference. Please file a bug report on bugs.php.net in vendor/composer/ClassLoader.php on line 444

Exception trace: () at vendor/magento/framework/App/ErrorHandler.php:61
Magento\Framework\App\ErrorHandler->handler() at vendor/composer/ClassLoader.php:444 include() at vendor/composer/ClassLoader.php:444
Composer\Autoload\includeFile() at vendor/composer/ClassLoader.php:322
Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
spl_autoload_call() at n/a:n/a class_exists() at setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:122
Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClasses() at setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:108
Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract() at setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:79
Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList() at setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php:61
Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation() at setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
Magento\Setup\Module\Di\App\Task\Manager->process() at setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:205
Magento\Setup\Console\Command\DiCompileCommand->execute() at vendor/symfony/console/Command/Command.php:242
Symfony\Component\Console\Command\Command->run() at vendor/symfony/console/Application.php:842
Symfony\Component\Console\Application->doRunCommand() at vendor/symfony/console/Application.php:193
Symfony\Component\Console\Application->doRun() at vendor/magento/framework/Console/Cli.php:104
Magento\Framework\Console\Cli->doRun() at vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at bin/magento:23


In vendor/composer/ClassLoader.php line 443~445

    include $file;

If I run php bin/magento deploy:mode:set production it will show this code

Enabled maintenance mode
Starting compilation
Something went wrong while compiling generated code. See the error log for details.
Command returned non-zero exit code:
`/opt/cpanel/ea-php71/root/usr/bin/php -f bin/magento setup:di:compile`
  • It seems like there is some error in some files you created recently. It could be any kind of error. As you may see that there is no line 444 in ClassLoader.php. So please provide us more of what you did recently. – Purushotam Sangroula Jan 4 '18 at 19:30
  • from 2.2.0 upgraded to 2,2.2 . the file line 444 is include $file; <-not wrong. how can i fix it,please help... – niceonelee Jan 4 '18 at 19:44
  • i used this php magento deploy:mode:set production getting need to run php bin/magento setup:di:compile – niceonelee Jan 4 '18 at 20:05
  • I updated in the post ~please check – niceonelee Jan 4 '18 at 20:51
  • can you show the code in /home/xxxx/public_html/vendor/composer/ClassLoader. php on line 444 – Purushotam Sangroula Jan 5 '18 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.