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

Missing @lezer/common transitive peer dependency of codemirror #1479

Closed
rtritto opened this issue Nov 26, 2024 · 6 comments
Closed

Missing @lezer/common transitive peer dependency of codemirror #1479

rtritto opened this issue Nov 26, 2024 · 6 comments

Comments

@rtritto
Copy link

rtritto commented Nov 26, 2024

Describe the issue

@lezer/common is a peer depedency of @codemirror/autocomplete.
@codemirror/autocomplete is a dependency of codemirror.
codemirror must also include @lezer/common dependency.

Reproduction:

  • yarn init -y
  • yarn set version berry
  • yarn add codemirror
  • (optional) yarn explain peer-requirements and see logs
    p9f5f8 → ✘ codemirror@npm:6.0.1 doesn't provide @lezer/common to @codemirror/autocomplete@npm:6.12.0 [53c64]
  • (detailed) yarn explain peer-requirements p9f5f8 and see logs
    Package codemirror@npm:6.0.1 is requested to provide @lezer/common by its descendants
    
    codemirror@npm:6.0.1
    └─ @codemirror/autocomplete@npm:6.12.0 [53c64] (via ^1.0.0)
    
    ✘ Package codemirror@npm:6.0.1 does not provide @lezer/common.

Workaround:

# .yarnrc.yml
packageExtensions:
  codemirror@*:
    dependencies:
      "@lezer/common": "*"

Browser and platform

No response

Reproduction link

No response

@rtritto rtritto changed the title Missing @lezer/common transitive peer dependency Missing @lezer/common transitive peer dependency of codemirror Nov 26, 2024
@marijnh
Copy link
Member

marijnh commented Nov 26, 2024

@lezer/common is a peer depedency of @codemirror/autocomplete.

No, it's a regular dependency. And since codemirror does not reference it, it doesn't declare it.

Yarn making up new rules, or whatever is going on here, is not something I'm willing to concern myself with. I recommend using npm, which is a lot less broken at this point.

@marijnh marijnh closed this as completed Nov 26, 2024
@rtritto
Copy link
Author

rtritto commented Nov 26, 2024

@marijnh this missing dependency issue isn't related only with yarn. You can see logs also with npm and pnpm. I used yarn to get fast reproduction (detailed logs with commands instead of simple logs).
With any package manager you can do a clean install to get the warning issue in the logs.

package.json of@codemirror/autocomplete requires the @lezer/common dependency:

{
  "name": "@codemirror/autocomplete",
  "version": "6.18.3",
  "peerDependencies": {
    "@lezer/common": "^1.0.0"
  },
}

Simply add @lezer/common to package.json of codemirror:

{
  "name": "codemirror",
  "version": "6.0.1",
  "dependencies": {
+    "@lezer/common": "^1.2.3"
  },
}

If you dodn't know about transitive peer dependencies, this is an aricle: Implicit Transitive Peer Dependencies

marijnh added a commit to codemirror/autocomplete that referenced this issue Nov 26, 2024
@marijnh
Copy link
Member

marijnh commented Nov 26, 2024

It looks like, at some point, I added a peerDependencies clause to @codemirror/autocomplete's package file as an experiment, and then forgot about it. Does removing it (as in the linked patch) resolve this warning?

@rtritto
Copy link
Author

rtritto commented Nov 26, 2024

Does removing it (as in the linked patch) resolve this warning?

Yes, removing @lezer/common from peerDependencies in @codemirror/autocomplete will fix this issue.

@rtritto
Copy link
Author

rtritto commented Dec 17, 2024

@marijnh please can you do a new release for the @codemirror/autocomplete package? Current version is 6.18.3.

@marijnh
Copy link
Member

marijnh commented Dec 17, 2024

Sure. I've tagged 6.18.4

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