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 do no work in PNPM monorepo #970

Open
jelhan opened this issue Oct 16, 2024 · 1 comment
Open

Overrides do no work in PNPM monorepo #970

jelhan opened this issue Oct 16, 2024 · 1 comment

Comments

@jelhan
Copy link
Contributor

jelhan commented Oct 16, 2024

PNPM supports pnpm.overrides and resolutions only at the root of a project. Ember Try sets it at the closest package.json. In a typical setup of a v2 addon that's the "test-app" package. That does not have any affect. Ember Try must set it in the package.json at the workspace root.

Likely there is a second bug: Ember Try sets overrides at the root of the package.json. That's correct for NPM. But I think for PNPM it must go into a pnpm member. This is an example taken from PNPM documentation:

{
  "dependencies": {
    "foo": "^1.0.0"
  },
  "pnpm": {
    "overrides": {
      "foo": "$foo"
    }
  }
}

But Ember Try generates the following, which is valid for NPM but does not fit with PNPM documentation:

{
  "dependencies": {
    "foo": "^1.0.0"
  },
  "overrides": {
    "foo": "$foo",
  }
}
@kategengler
Copy link
Member

Using pnpm in a monorepo I see:
WARN  The field "pnpm.overrides" was found in test-app/package.json. This will not take effect. You should configure "pnpm.overrides" at the root of the workspace instead.

So I think pnpm is telling us exactly what it wants.

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