• Uncategorized

About php : Uncaught-Error-Class-ComposerAutoloaderInit-not-found

Question Detail

After attempting to remove and reinstall a package I’m getting this new error when I try to include('vendor/autoload.php');

Fatal error: Uncaught Error: Class >’ComposerAutoloaderInit7b3c839efeba468a3d595a365ceb8e89′ not found in >mypath\vendor\autoload.php:7 Stack trace: #0 mypath\mypage.php(2): include() >#1 {main} thrown in mypath\vendor\autoload.php on line 7

I’ve tried running composer clearcache before and after reinstalling the package. I deleted C:/Users/MyUsername/AppData/Roaming/Composer and even completely uninstalled Composer. After I reinstalled composer and then reinstalled the package, the error message remains.

What am I missing? I feel like it has a hidden cache somewhere that’s breaking this.

Question Answer

Your autoloader seems to be on an unfit state.

Just regenerate it.

composer dump-autoload

If this doesn’t work (although it should), simply remove the whole vendor directory, and run composer install again.

Clearing composer’s cache has no effect on this, since this is only the one used by composer to avoid downloading files all over again, not a project level cache.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.