php – Uncaught Error: Class 'Magento\Framework\App\Cache\Frontend\Factory' not found-ThrowExceptions

Exception or error:

I am getting this error in magento. Checked etc/di.xml file.
I have no clue whats going on and why this started in the first place.

I have tried deleting the cache and also disabling the cache but there was no change.

Fatal error: Uncaught Error: Class 'Magento\Framework\App\Cache\Frontend\Factory' not found in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:122 Stack trace: #0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...') #2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Framewo...') #3 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...') #4 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Framewo...') #5 /var/www/html/ in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 122
How to solve:

PHP does not know the class Magento\Framework\App\Cache\Frontend\Factory. Somewhere in your code there must be a file containing something like:

<?php

namespace Magento\Framework\App\Cache\Frontend;

class Factory
{ ... }

Maybe the file is not existing in your source code (maybe you are missing the library where the class is defined). Or the file exists but cannot be loaded because your autoloading is not working as you expect. Autoloading is done with Composer usaually. With this info you can maybe start debugging..

Leave a Reply

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