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
You can run this command and paste results here
php bin/magento setup:di:compile
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
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:
bin/magento setup:upgrade
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
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!
This is the right solution and worked for me
Thanks