I can't install Magento Module in my Store

Hello,

II want to implement the payment methods provided by SquareUp in my online store that uses Magento 2.4.6p3.

I downloaded the module according to the official documentation via composer:
php composer require square/module-squareup-omni square/connect

When activating the module and executing the command:
php bin/magento setup:upgrade

I’m getting the following error, which won’t let me use the SquareUp module:

There is an error in /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php at line: 50
Cannot instantiate interface Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface#0 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()
#1 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get()
#2 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument()
#3 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument()
#4 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime()
#5 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments()
#6 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()
#7 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get()
#8 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument()
#9 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument()
#10 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime()
#11 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments()
#12 /vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()
#13 /vendor/magento/framework/Setup/Patch/PatchApplier.php(149): Magento\Framework\ObjectManager\ObjectManager->create()
#14 /setup/src/Magento/Setup/Model/Installer.php(1097): Magento\Framework\Setup\Patch\PatchApplier->applyDataPatch()
#15 /setup/src/Magento/Setup/Model/Installer.php(963): Magento\Setup\Model\Installer->handleDBSchemaData()
#16 /setup/src/Magento/Setup/Console/Command/UpgradeCommand.php(147): Magento\Setup\Model\Installer->installDataFixtures()
#17 /vendor/symfony/console/Command/Command.php(298): Magento\Setup\Console\Command\UpgradeCommand->execute()
#18 /vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#19 /vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#20 /vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun()
#21 /vendor/symfony/console/Application.php(171): Magento\Framework\Console\Cli->doRun()
#22 /bin/magento(23): Symfony\Component\Console\Application->run()
#23 {main}

This really isn’t a Square error. It’s an error with the Magento integration. I’m not entirely sure how to fix it but you may want to try the following since the error indicates that Magento cannot instantiate the Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface interface, which is necessary for the operation of the SquareUp module or another module that depends on it.

Here are the steps to troubleshoot and fix the error:

  1. Clear the cache and generated code:
bin/magento cache:clean
bin/magento cache:flush
rm -rf var/cache/* var/page_cache/* generated/code/*
  1. Run the setup upgrade command:
bin/magento setup:upgrade
  1. Check if the Magento_InventoryCatalogApi module is enabled:
bin/magento module:status Magento_InventoryCatalogApi

If it is disabled, enable it:

bin/magento module:enable Magento_InventoryCatalogApi
  1. Run the setup upgrade command again:
bin/magento setup:upgrade
  1. If the error persists, investigate any custom modules or third-party extensions that may be causing a conflict. Disable them if necessary:
bin/magento module:disable VendorName_ModuleName
  1. If you have recently installed or updated the SquareUp module, ensure that all its dependencies are met and it is compatible with your Magento version.
    :slightly_smiling_face:

Hello,

Thanks for responding, but I’m still having the same problem.

By running this command:
bin/magento module:status Magento_InventoryCatalogApi

I get this:
Magento_InventoryCatalogApi : Module is enabled

So, I run these commands:
bin/magento cache:clean
bin/magento cache:flush
rm -rf var/cache/* var/page_cache/* generated/code/*

Then:
bin/magento setup:upgrade

And I keep getting the same error:
There is an error in /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php at line: 50
Cannot instantiate interface Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface#0 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()

Okay, then I’d recommend that you reach out to the Magento support team for additional assistance. :slightly_smiling_face: