Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot be installed in conjunction with 'wp-graphql-woocommerce' #67

Open
efoken opened this issue Jan 29, 2020 · 7 comments
Open

Cannot be installed in conjunction with 'wp-graphql-woocommerce' #67

efoken opened this issue Jan 29, 2020 · 7 comments

Comments

@efoken
Copy link
Contributor

efoken commented Jan 29, 2020

I just tried to install this plugin in conjunction with the WPGraphQL WooCommerce addon, but Composer blocks installation because of firebase/php-jwt 5.0 which is required by 'wp-graphql-woocommerce' and this package required version 4.0

Note that I'm using Bedrock with Composer to install WordPress plugins and I'm installing WPGraphQL and addons using GitHub URLs.

Here's what Composer outputs:

Loading composer repositories with package information
Updating dependencies (including require-dev)         
Your requirements could not be resolved to an installable set of packages.

Problem 1
    - Installation request for wp-graphql/wp-graphql-woocommerce dev-develop -> satisfiable by wp-graphql/wp-graphql-woocommerce[dev-develop].
    - wp-graphql/wp-graphql-jwt-authentication dev-master requires firebase/php-jwt ^4.0 -> satisfiable by firebase/php-jwt[v4.0.0].
    - wp-graphql/wp-graphql-jwt-authentication dev-master requires firebase/php-jwt ^4.0 -> satisfiable by firebase/php-jwt[v4.0.0].
    - Conclusion: don't install firebase/php-jwt v4.0.0
    - Installation request for wp-graphql/wp-graphql-jwt-authentication dev-master -> satisfiable by wp-graphql/wp-graphql-jwt-authentication[dev-master].
@jasonbahl
Copy link
Collaborator

@efoken interesting. As far as I know these plugins should install their dependencies to their own plugin directories, but we can look into it.

@Fredrik-J
Copy link

Fredrik-J commented Jan 31, 2020

I got the same problem.

composer require wp-graphql/wp-graphql-jwt-authentication
Using version ^0.3.5 for wp-graphql/wp-graphql-jwt-authentication
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: firebase/php-jwt[v4.0.0, v5.0.0].
    - Can only install one of: firebase/php-jwt[v5.0.0, v4.0.0].
    - Can only install one of: firebase/php-jwt[v4.0.0, v5.0.0].
    - wp-graphql/wp-graphql-jwt-authentication v0.3.5 requires firebase/php-jwt ^4.0 -> satisfiable by firebase/php-jwt[v4.0.0].
    - Installation request for wp-graphql/wp-graphql-jwt-authentication ^0.3.5 -> satisfiable by wp-graphql/wp-graphql-jwt-authentication[v0.3.5].
    - Installation request for firebase/php-jwt (locked at v5.0.0) -> satisfiable by firebase/php-jwt[v5.0.0].

Installation failed, reverting ./composer.json to its original content.

@efoken
Copy link
Contributor Author

efoken commented Feb 25, 2020

@jasonbahl If I download the plugins as ZIP file and install them, of course, it works as all plugins have their own vendor folder. But if one uses Bedrock and installs these plugins via Composer, all packages install their dependencies into the root vendor directory, so that they can conflict

@jasonbahl
Copy link
Collaborator

@efoken is there a way to configure composer.json to make sure these dependencies get installed into their respective project vendor folders? Unless I'm mistaken (@kidunot89 can clarify) WPGraphQL JWT Auth and WPGraphQL for WooCommerce aren't tightly coupled and should be able to run independently or together, regardless of their own composer dependencies.

If we could tell composer to install composer dependencies of the JWT plugin under the JWT plugin vendor directory, and the dependencies for WooGraphQL under the WooGraphQL vendor directory, that might solve the issue.

If WooGraphQL requires WPGraphQL JWT Auth to be active to use, then perhaps WooGraphQL could just remove the composer dependency altogether, document that WPGraphQL JWT Auth needs to be active, and then call the functions/classes that are included by that plugin being active?

I'm not opposed to updating the firebase dependency for this plugin, but I do think the 2 plugins should be able to iterate without a tight coupling to each other if we can make that happen.

@kidunot89
Copy link
Member

kidunot89 commented Feb 25, 2020

@jasonbahl WooGraphQL using firebase/php-jwt to create the Session tokens, but I hadn't don't any testing using the composer package. Is it possible to simply update WPGraphQL-JWT-Auth to 5.0, I don't believe it'll cause any breaks code-wise.

@kidunot89
Copy link
Member

@efoken Have you tried deleting your vendor and composer.lock and running composer install --no-dev?

@efoken
Copy link
Contributor Author

efoken commented Mar 7, 2020

@jasonbahl Composer handles dependencies like that, we have only one vendor directory, so only one version of a package can be installed – no matter what. The only solution is to update firebase/php-jwt to 5.x, the same version as it is used in wp-graphql. I've created a PR for that #84

https://stackoverflow.com/questions/27150695/how-does-composer-handle-multiple-versions-of-the-same-package/27153452

@kidunot89 I tried ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants