-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-source-graphql): support yarn 2 #21054
Conversation
The I'm not sure, but this approach can produce errors like this in some cases, depending on how package manager will construct |
Tagging @arcanis and @larixer here following the discussion we had on discord. Basically the problem now looks something like this
Since A suggestion made by @larixer is to list Another potential solution made by @arcanis suggest that we list For this particular case though, both Got any other ideas? Maybe something related to |
Would making |
@esphen Interesting. But I think it's essentially the same as listing the version equal to the one in I feel like eventually we can break down to when or how duplicate packages would happen. If it's unlikely to happen in this context then we can safely ignore it? |
But one in gatsby changes periodically (when we bump deps), so it would be tricky to try to keep same version in core as in this plugin. And because user can have mismatched core and plugin versions those might drift and resolve to different instances of graphql package. I'm not sure if using wildcard version selector ( |
@pieh
I guess we'll have to keep an eye on it and make sure So this PR is no longer needed as it's already a dependency. Thanks for taking your time and opening this 👍 |
Description
In order to support yarn 2 (berry, PnP). We have to list
graphql
as dependency ingatsby-source-graphql
. The approach I take here is to simply list it as dependency rather than usingcreateRequire
as seen in #20638 due to the suggestions #20638 (review) and yarnpkg/berry#689 (comment). It should also be compatible to npm or yarn 1. I've tested it with the reproduction repo created by @esphen.Related Issues
Addresses #20949 (comment)