ReflectionException: Class Interceptor does not exist in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:19

magento.stackexchange https://magento.stackexchange.com/questions/318743

Question

I'm getting this error on my homepage

ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:19 Stack trace: #0 /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #1 /var/www/html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...') #3 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array) #4 /var/www/html/vendor/magento/framework/App/Bootstrap.php(235): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo...', Array) #5 /var/www/html/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\Framewo...') #6 {main}

So I tried to setup:di:compile

I had an error in vendor/aheadworks/module-acr/Controller/Adminhtml/Wysiwyg/Directive.php

It was using a missing class use Magento\Framework\App\Action\HttpGetActionInterface;

So I wrote that class in order to make the setup:di:compile works

Compilation was started. Interception cache generation... 7/7 [============================] 100% 31 secs 380.0 MiB Generated code and dependency injection configuration successfully.

But I keep getting the same error on my main page, any ideas ?

No correct solution

OTHER TIPS

try to clean generated folder. Than:

  • composer install
  • bin/magento setup:upgrade
  • bin/magento setup:di:compile
  • bin/magento setup:static-content:deploy -f
  • bin/magento cache:flush

cheers

Run the following commands.

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/

I suggest 2 steps:

step 1: disable this module we have identified as having an issue

php bin/magento module:disable Aheadworks_Acr

if the command above returns an error, go to app/etc/config.php and set the entry for this module to 0 manually

at this point, the module is disabled and It does seems this module is the culprit for some custom config that is not configured correctly somehow.

step 2:

The problem with config is they get to be part of the cache and they can be persistent. Because your issue has to do with config, I advise to clear var/cache folder manually and also if you use redis, do redis-cli flushall.

Once these 2 steps are complete, you should be able to run

php bin/magento cache:clean successfully

and your site should be back up.

Now, it may just be a syntax issue on your Aheadworks module and these guys have been on the market for long enough to say the module is likely working fine but somehow a syntax issue has cropped up..

So In fact the real problem here was due to a wrong docker installation (This project was runing under the same port as an other one). Meanings all the commands were in fact running under the wrong project.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top