When I try to execute any magento command it gives me the following error:

PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Framework\Interception\ConfigLoaderInterface in /home/vagrant/code/%PROJECT%/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

As you can see in the error message I am using a vagrant box to try and get my project running locally. Just did a composer update and magento update to 2.4.5. Can't get the project to work without updating either. I am using php 8.1, php-fpm 8.1 and magento package: magento/product-community-edition: 2.4.5

My di.xml does contain the line:

<preference for="Magento\Framework\Interception\ConfigLoaderInterface" type="Magento\Framework\Interception\PluginListGenerator" />

Also tried to use the di.xml from https://github.com/magento/magento2/blob/2.4.3-release/app/etc/di.xml

1 Answer 1


Possible reasons and solutions you can do to steps to reproduce:

1: Check your app/etc/di.xml and you need to match your di.xml with the latest Magento 2.4.5 release.

2: Also backup your vendor folder and: rm -rf vendor/* composer clearcache composer install then compile magento and run command like (setup upgrade.... cache flush)

3: Try below commands:

php bin/magento setup:di:compile

rm -Rf var/view_proccessed rm -Rf var/cache rm -Rf pub/static/frontend php bin/magento setup:static-content:deploy -f php bin/magento c:f or php bin/magento cache:flush

Reproducing your custom module vagrant may create some errors while compiling the code.

4: Also add this preference in your module (vagrant) di.xml, i.e., might use a dependency with Config loader.

5: Also clear the cache, i.e, also Redis cache (If use)

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.