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

Use overrides to fix reflux peerDependency resolution #4704

Merged
merged 1 commit into from
Nov 2, 2023

Commits on Oct 26, 2023

  1. Fix peerDependency ERR from Reflux in npm >= 8.6.0

        "overrides": {
          "reflux": { "react": "$react"}
        },
    
    This tells npm that Reflux should use our project-level version of React
    to resolve its dependency on "react". This override applies even though
    our project-level React (16) falls outside of the semver range that
    Reflux wants (^15.0.2).
    
    Alternatively, this would work:
    
        "overrides": {
          "react": "$react"
        },
    
    However, the next time we upgrade React, I'd like to see warnings from
    other libraries (if applicable) so we can be sure to upgrade them.
    
    We override this for Reflux because it's not likely to receive updates,
    yet it tends to continue to work with newer versions of React without
    any problem.
    
    References:
    
      overrides on npm
      https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides
    
      Helpful comment on the Node breakage thread
      npm/cli#4998 (comment)
    
    The error you'd see when using npm >= 8.6.0 looked like:
    
      npm ERR! code ERESOLVE
      npm ERR! ERESOLVE could not resolve
      npm ERR!
      npm ERR! While resolving: reflux@6.4.1
      npm ERR! Found: react@16.13.1
    p2edwards committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    d864092 View commit details
    Browse the repository at this point in the history