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

Overrides seem to not work on peer deps #7952

Open
zkochan opened this issue Apr 17, 2024 · 2 comments
Open

Overrides seem to not work on peer deps #7952

zkochan opened this issue Apr 17, 2024 · 2 comments

Comments

@zkochan
Copy link
Member

zkochan commented Apr 17, 2024

          > > In [DimensionDev/Maskbook@4f5f116 (#11571)](https://github.com/DimensionDev/Maskbook/pull/11571/commits/4f5f1161f8e01f6253957fffcf1428b2984cab2d) (Good state), if you search "react@18.2.0" you'll find nothing, but if you change package.json to "packageManager": "pnpm@9.0.1", and run pnpm install, now the lockfile contains "react@18.2.0" and the app is broken.

I you want to override the version of react, use an override

img

Yes! I'm using it but still have the problem. Just tried again with 9.0.2

Originally posted by @Jack-Works in #7934 (comment)

@zkochan zkochan changed the title > > In [DimensionDev/Maskbook@4f5f116 (#11571)](https://github.com/DimensionDev/Maskbook/pull/11571/commits/4f5f1161f8e01f6253957fffcf1428b2984cab2d) (Good state), if you search "react@18.2.0" you'll find nothing, but if you change package.json to "packageManager": "pnpm@9.0.1", and run pnpm install, now the lockfile contains "react@18.2.0" and the app is broken. Overrides seem to not work on peer deps Apr 17, 2024
@hmnd
Copy link

hmnd commented Apr 25, 2024

Can confirm this is an issue. Had to revert back to v8 for now unfortunately. Happy to provide anything that might be of assistance!

@moltar
Copy link

moltar commented Apr 27, 2024

After hours of debugging this issue, I can confirm this is definitely the case.

Here's my case:

In the monorepo root package.json:

  "pnpm": {
    "peerDependencyRules": {
      "allowedVersions": {
        "@aws-cdk/integ-tests-alpha>aws-cdk-lib": ">=2.100.0",
        "@aws-cdk/app-staging-synthesizer-alpha>aws-cdk-lib": ">=2.100.0"
      }
    }
  },

In the package in question:

  "devDependencies": {
    "@aws-cdk/app-staging-synthesizer-alpha": "2.138.0-alpha.0",
    "@aws-cdk/integ-runner": "2.138.0-alpha.0",
    "@aws-cdk/integ-tests-alpha": "2.138.0-alpha.0",
    "aws-cdk": "2.100.0",
    "aws-cdk-lib": "2.100.0"
  },
  "peerDependencies": {
    "aws-cdk-lib": "^2.100.0"
  },

Error raised when running like this: pnpm i --no-frozen-lockfile --reporter ndjson (also see #7978 why)

    "packages/aws-cdk-my-pacakge": {
      "bad": {
        "aws-cdk-lib": [
          {
            "foundVersion": "2.100.0",
            "resolvedFrom": [],
            "parents": [
              {
                "name": "@aws-cdk/app-staging-synthesizer-alpha",
                "version": "2.138.0-alpha.0"
              }
            ],
            "optional": false,
            "wantedRange": "^2.138.0"
          },
          {
            "foundVersion": "2.100.0",
            "resolvedFrom": [],
            "parents": [
              {
                "name": "@aws-cdk/integ-tests-alpha",
                "version": "2.138.0-alpha.0"
              }
            ],
            "optional": false,
            "wantedRange": "^2.138.0"
          }
        ]
      },

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

3 participants