5

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. – Javier Villanueva Sep 20 '18 at 16:27
  • 1
    ? Vendor is ok ..? He have a problem to find Magento/Framework/App/ResourceConnection/Proxy.php in folder enerated/code – Andre Bubner Sep 20 '18 at 16:46
  • Please remove generated folder from root and try if it not work set dev mode using htaccess – Rutvee Sojitra Sep 20 '18 at 17:10
  • 3
    @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 – Javier Villanueva Sep 21 '18 at 13:19
6

Solution was:

rm -rf vendor/* and run composer install

Thanks to Javier Villanueva

| improve this answer | |
  • 1
    Glad you found a solution :) – Greg Sep 21 '18 at 9:56
  • Great! You save my day – chirag dodia Jan 28 '19 at 8:23
3

Run composer dump-autoload in the root Magento directory.

| improve this answer | |
0

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

| improve this answer | |
  • In Magento 2.2.6 there are no folders like : var/generation and var/di – Andre Bubner Sep 20 '18 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 – Andre Bubner Sep 20 '18 at 16:45
  • How about removing the pub/static/ and everything from vendor? – Greg Sep 21 '18 at 8:27

Your Answer

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

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