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

Peer dependencies shouldn't also be actual dependencies #1369

Open
justinmchase opened this issue Jun 10, 2021 · 0 comments
Open

Peer dependencies shouldn't also be actual dependencies #1369

justinmchase opened this issue Jun 10, 2021 · 0 comments

Comments

@justinmchase
Copy link

I just encountered an issue installing this where multiple instances of react are running and end up conflicting. This happens when you have any other dependency which depends on react but is different from operational.

Operational publishes the peer dependency information but it also puts those peer dependencies as actual dependencies. This results in operational actually trying to install different versions of these peer dependencies which causes a react runtime issue.

To compound the issue operation publishes the wrong peer dependency versions:

{
  "peerDependencies": {
    "react": "^16.8.0",
    "react-dom": "^16.8.0",
    "react-emotion": "^9.2.5"
  },
  "dependencies": {
    "react": "^16.8.1",
    "react-dom": "^16.8.1",
    "react-emotion": "^10.0.0",
  }
}

Notice the react peers are requesting 16.8.0 but the actual dependencies are 16.8.1. react-emotion is just totally wrong, and so if you install the published peer dependency exactly then it fails. I didn't check the other peer dependencies, these were the only three giving me issues.

I believe the solution is to just remove the dependencies which are also listed in peerDependencies, it's possible that listing them as devDependencies is ok also but I think having them as hard dependencies causes some confusing conflicts at install time.

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

1 participant