cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface in Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface in /home/user/example.com/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50 Stack trace: #0 /home/user/example.com/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...') #1 /home/user/example.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...') #2 /home/user/example.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Store\\A...', NULL, 'storeRepository', 'Magento\\Store\\A...') #3 /home/user/example.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgu in /home/user/example.com/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

4 REPLIES 4

Re: Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInter

You can run this command and paste results here 

php bin/magento setup:di:compile

Re: Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInter

If php bin/magento setup:di:compile not working then remove cache including var/di and var/generation, via FTP then try to run compile command.
Thanks

Re: Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInter

Hello ecinitiative,

 

Command Line Interface, CLI, is a text-based user interface used to view and manage files. It connects a user to a computer program or operating system. Magento has a default CLI command. However, you can call CLI commands using shortcuts instead of the entire command.

 

The error is created when you try creating a (new) object (class) and haven't overridden the interface for a class in the di.xml file and tried to use it. The error can also occur by enabling or disabling the modules directly in app/etc/config.php. Therefore, to fix the error, "Fatal error: Uncaught Error: Cannot instantiate interface," follow the steps below:

 

  • Firstly, run the following command,
bin/magento setup:upgrade
  • The above command clears compiled code, the cache, and updates components.
  • Now, check if the following two files exist:
  1. app/etc/env.php > In this file, Magento 2 stores the database credentials, backend URL, enabled cache types, etc.
  2. app/etc/config.php > File contains the list of installed modules, themes, language packages, and shared configuration settings.
  • Nextly, check the database settings and redis connection information credentials are correct.
  • If they are correctly set, re-run the below command,
bin/magento setup:upgrade

 

If you still face the same error, "Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface." you can run the below command to fix the issue,

php -dmemory_limit=-1 bin/magento setup:di:compile
  • The option -dmemory_limit = -1 allows you to run PHP in the CLI without memory limits. Also, you can change the memory_limit setting.
  • The command 'bin/magento setup:di:compile' generates DI configuration and all missing classes that can be auto-generated

 

I hope the above-given fix helps you to fix the Fatal error in Magento. However, if the issue persists, you can update us here.

---------------------------
Regards,
Rex M

Problem solved? Click Accept as Solution!

 

AccuWeb Hosting | Magento Hosting

Re: Fatal error: Uncaught Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInter

This is the right solution and worked for me

Thanks