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

react-redux and redux should be peer dependencies #1298

Open
1 of 7 tasks
simoneb opened this issue Dec 20, 2020 · 5 comments · May be fixed by #1391
Open
1 of 7 tasks

react-redux and redux should be peer dependencies #1298

simoneb opened this issue Dec 20, 2020 · 5 comments · May be fixed by #1391

Comments

@simoneb
Copy link

simoneb commented Dec 20, 2020

This issue pertains to the following package(s):

  • GraphQL Playground - Electron App
  • GraphQL Playground HTML
  • GraphQL Playground React
  • GraphQL Playground Express Middleware
  • GraphQL Playground Hapi Middleware
  • GraphQL Playground Koa Middleware
  • GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

Windows 10

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

graphql-playground-react 1.7.27

What is the expected behavior?

The package should not install react-redux and redux

What is the actual behavior?

The package installs react-redux and redux

What steps may we take to reproduce the behavior?

  • Create a new create-react-app using yarn as package manager
  • Install graphql-playground-react and react-redux to import the Provider from
  • Use the Playground React component as described in the docs, wrapped by the Provider
  • start the app and see it fail

The issue is that Redux and React redux and such kind of packages that should not occur in multiple versions within the same app. Therefore, they should not be installed by graphql-playground-react but they should be marked as devDependencies and peerDependencies.

Note that the issue happens with yarn because of its hoisting behavior, and it doesn't happen when using npm. Regardless, it's conceptually wrong to embed such dependencies and it should be documented that they need to be installed by the hosting application instead.

@idiglove
Copy link

I'm trying to debug this issue, my question is what errors do you see? @simoneb
I did the steps you said, the playground doesnt load and I get these
image

@simoneb
Copy link
Author

simoneb commented Feb 23, 2022

@idiglove this issue is fairly old and I don't have the repro at hand anymore, but I suspect that the errors you posted are the manifestation of the issue.

@idiglove
Copy link

I cant run even without redux with v1.7.28
Getting these errors
image

@simoneb
Copy link
Author

simoneb commented Feb 23, 2022

These errors usually happen when there are.muktiole versions of React (and some related packages) running in your app

@ausov
Copy link

ausov commented Aug 24, 2022

Note, as a workaround adding package extensions to .yarnrc.yml seems work fine:

packageExtensions:
  '[email protected]':
    peerDependencies:
      'react': "*"
      'react-dom': "*"
      'react-redux': "*"

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