0

Repositories code generation... 1/9 [===>------------------------] 11% < 1 sec 117.0 MiBsyntax error, unexpected token "&", expecting "function" or "const"#0 /var/www/myshop/vendor/composer/ClassLoader.php(433): Composer\Autoload{closure}() #1 [internal function]: Composer\Autoload\ClassLoader->loadClass() #2 /var/www/myshop/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists() #3 /var/www/myshop/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass() #4 /var/www/myshop/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract() #5 /var/www/myshop/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList() #6 /var/www/myshop/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation() #7 /var/www/myshop/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process() #8 /var/www/myshop/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute() #9 /var/www/myshop/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run() #10 /var/www/myshop/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand() #11 /var/www/myshop/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun() #12 /var/www/myshop/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun() #13 /var/www/myshop/bin/magento(23): Symfony\Component\Console\Application->run() #14 {main}

asked Apr 5, 2023 at 14:49
3
  • which magento 2 version is in there? is it compatible with php 8.1? Commented Apr 6, 2023 at 7:55
  • magento2.4.4 php version 8.1-fpm Commented Apr 6, 2023 at 11:53
  • and have you checked what is in the file? /var/www/myshop/vendor/composer/ClassLoader.php(433): (what is on that 433 line) Commented Apr 7, 2023 at 6:54

1 Answer 1

1
  • Add below line on /var/www/myshop/vendor/composer/ClassLoader.php(434)

echo "Class: ".$file."\n";

After adding please run php bin/magento setup:di:compile command. and check the last compilation file and Review the code of that file. once you found and fix it please remove that line.

answered May 23, 2023 at 6:07
2
  • Thanks for your response I have already cleared this error Commented May 23, 2023 at 8:16
  • I know that but I posted the answer because it helps to another one. And Thank You for your response. Commented May 23, 2023 at 8:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.