yireo / magento2-replace-graphql

Magento 2 meta-package to replace all optional GraphQL modules
17 stars 19 forks source link

Uncaught Error: Interface 'Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface' #15

Closed fballiano closed 3 years ago

fballiano commented 4 years ago

Hi guys, on a vanilla M2.4.0 + your replace-graphql repo I'm getting this error while lunching a setup:di:compile

Repositories code generation... 1/8 [===>------------------------]  12% < 1 sec 77.0 MiBPHP Fatal error:  Uncaught Error: Interface 'Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface' not found in /var/www/html/vendor/paypal/module-braintree-graph-ql/Model/BraintreeDataProvider.php:16
Stack trace:
#0 /var/www/html/vendor/composer/ClassLoader.php(444): include()
#1 /var/www/html/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#3 [internal function]: spl_autoload_call()
#4 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists()
#5 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass()
#6 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract()
#7 /var/www/html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\Clas in /var/www/html/vendor/paypal/module-braintree-graph-ql/Model/BraintreeDataProvider.php on line 16

did you ever encounter something like this? thanks a lot!

jissereitsma commented 4 years ago

The error shows that the Braintree GraphQL module is still there, but in this repository it is actually removed: https://github.com/yireo/magento2-replace-graphql/blob/magento-2.4.0/composer.json#L8 Could it be that you are using the wrong version of this package?

fballiano commented 4 years ago

this is part of the composer.json:

    "require": {
        "magento/composer-root-update-plugin": "~1.0",
        "magento/product-community-edition": "2.4.0",
        "markshust/magento2-module-disabletwofactorauth": "^1.0",
        "yireo/magento2-replace-graphql": "^4.0"
    },

that's really wierd cause yes it seems the module it's still there but I've also removed the vendor folder completely and re-done a "composer install"

jissereitsma commented 4 years ago

Could you try with removing the composer.lock as well?

fballiano commented 4 years ago

I removed it when reinstalling, super weird

jissereitsma commented 4 years ago

Just adding these replacements using composer require or manually adding it to composer.json and then running composer install does not work. Often it is needed to re-run composer install with an empty lock, to force composer to recalculate all dependencies :(

So the issue is solved?

fballiano commented 4 years ago

also removing the composer.lock and re-installing I get the same error (on php7.4).

I solved copying/pasting the replace lines but I had to "keep" the quote-graphql, customer-graphql, graphql

jissereitsma commented 4 years ago

Thanks. I've been trying this out again, but in my case, with a vanilla Magento 2.4.0 and PHP 7.4 and the mentioned packages, it simply works. This is also tested for in the GitHub Actions of this workspace. It almost seems if there are additional packages installed in your environment that are not part of my regular 2.4 installation. Perhaps because of Marketplace extensions you have installed. Either way, by inspecting the output of bin/magento module:status there should be zero GraphQL modules installed. In your case, there appear to be several. Could you report them so we know which packages are actually still there?

jissereitsma commented 3 years ago

I'm going to close this due to inactivity. Feel free to reopen when this is still relevant.