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

Issue: Yarn PnP throws an error because "@apollo-client-react-streaming" requires "graphql" but does not list it as a dependency #417

Closed
Rewwoken opened this issue Jan 22, 2025 · 3 comments

Comments

@Rewwoken
Copy link

Rewwoken commented Jan 22, 2025

Issue

If pnpMode is set to "strict" (which is the default value), modules won't be allowed to require packages they don't explicitly list in their own dependencies.

Yarn PnP throws an error because of transportedOptions.ts#L8 import statement which imports graphql package, but this package is listed in devDependencies.

Image

Suggested change

I suggest moving graphql package from devDependencies to dependencies.

Workarounds for now:

In .yarnrc.yml, either set pnpMode to loose

pnpMode: loose

or explicitly list graphql as a dependency

packageExtensions:
  # Package requires `graphql` but doesn't list it as a dependency
  "@apollo/client-react-streaming@*":
    dependencies:
      "graphql": "*"

I hope I’ve understood the problem correctly. Please let me know if there are any inaccuracies.

@phryneas
Copy link
Member

Good point - but it should be a peerDependency.

This is a good wakeup call to finally configure knip - I'm doing that and adding this peerDependency over in #418

@phryneas
Copy link
Member

This should be solved in 0.11.8

Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

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

No branches or pull requests

2 participants