Im am using Magento 2.2.6 and try to switch to the dev mode (before production).

I do it like described in: https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-mode.html

  1. rm -rf /generated/metadata/* /generated/code/*

  2. bin/magento deploy:mode:set developer

But at point 2. i get this error:

www-data@602f3683557f:~/html$ bin/magento deploy:mode:set developer
Warning: include(/var/www/html/vendor/composer/../../generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): failed to open stream: No such file or directory in /var/www/html/vendor/composer/ClassLoader.php on line 444

So, any ideas whats going on here?

  • You can try clearing the vendor folder rm -rf vendor/* and run composer install again to reinstall dependencies. Sep 20, 2018 at 16:27
  • 1
    ? Vendor is ok ..? He have a problem to find Magento/Framework/App/ResourceConnection/Proxy.php in folder enerated/code Sep 20, 2018 at 16:46
  • Please remove generated folder from root and try if it not work set dev mode using htaccess Sep 20, 2018 at 17:10
  • 5
    @AndreBubner the problem is that composer's autoloader was still referencing classes that were removed from the generated folder, so my idea was to force composer to regenerate its autoloader which can also be done with composer dump-autoload Sep 21, 2018 at 13:19

4 Answers 4


Solution was:

rm -rf vendor/* and run composer install

Thanks to Javier Villanueva

  • 1
    Glad you found a solution :)
    – Greg
    Sep 21, 2018 at 9:56
  • Great! You save my day Jan 28, 2019 at 8:23

Run composer dump-autoload in the root Magento directory.


Sometimes I get similar error when trying to compile and running this usually solves the problem:

rm -rf var/generation var/di

and then try to switch to developer mode again:

bin/magento deploy:mode:set developer

  • In Magento 2.2.6 there are no folders like : var/generation and var/di Sep 20, 2018 at 16:44
  • ~/html/var$ ls -ltr total 4 drwxrwxr-x 3 www-data www-data 96 Sep 20 04:26 page_cache drwxrwxr-x 5 www-data www-data 160 Sep 20 04:26 composer_home drwxrwxr-x 2 www-data www-data 64 Sep 20 04:30 session drwxrwxr-x 3 www-data www-data 96 Sep 20 04:41 view_preprocessed drwxrwxr-x 5 www-data www-data 160 Sep 20 05:06 log -rw-rw-r-- 1 www-data www-data 211 Sep 20 07:23 resource_config.json Sep 20, 2018 at 16:45
  • How about removing the pub/static/ and everything from vendor?
    – Greg
    Sep 21, 2018 at 8:27

In Magento ver. 2.4.5-p5 I got the same Proxy class error.

I fixed it by executing the below commands and my issue was resolved.

rm -rf generated/metadata/* generated/code/*

composer install

php bin/magento deploy:mode:set developer

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.