Magento 2 – Fix Setup Compile Error for Non-Existing Class

magento2

I installed magento 2 Community version successfully. Now when i try to upgrade the setup i get the error Please re-run Magento compile command.

So i ran the compile command

magento setup:di:compile

but i am getting this error

Area configuration aggregation... 5/7 [====================>-------]  71% 35 min
s 736.2 MiB

  [ReflectionException]
  Class Not_Existing_Class does not exist


  [ReflectionException]
  Class Not_Existing_Class does not exist

Any ideas as to how this can be resolved ?!

Thanks in advance.

Best Answer

Update setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php

if (preg_match($pattern, $fileItem->getRealPath())) {

to

if (preg_match($pattern, str_replace('\\', '/', $fileItem->getRealPath()))) {

Check this Link. Issue is fixed by Magento

Related Topic