8000 `dependenciesMeta`'s `"inject": true` doesn't replace `catalog:` protocol · Issue #8715 · pnpm/pnpm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dependenciesMeta's "inject": true doesn't replace catalog: protocol #8715

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

Closed
2 of 4 tasks
ahkhanjani opened this issue Oct 29, 2024 · 4 comments
Closed
2 of 4 tasks

Comments

@ahkhanjani
Copy link
ahkhanjani commented Oct 29, 2024

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

9.12.3

Which area(s) of pnpm are affected? (leave empty if unsure)

Dependencies resolver

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

  1. Have a workspaces monorepo.
  2. Have a package that uses catalog: in its dependencies (Let's name it @acme/auth).
  3. Have another app/package that uses @acme/auth with @acme/auth being injected.
  4. Run pnpm i.

Example:

// apps/my-app/package.json
"dependencies": {
  "@acme/auth": "workspace:*",
},
"dependenciesMeta": {
  "@acme/auth": {
    "injected": true
  },
}

// packages/auth/package.json
"dependencies": {
  "react": "catalog:",
}

Describe the Bug

Screenshot 2024-10-30 023641

Here @acme/auth is injected in the app and uses catalogs in its dependencies. Replacing all catalog instances with an actual version fixes the issue. It only happens when @acme/auth uses catalogs directly. There is no problem for its dependencies using catalogs.

Expected Behavior

Resolve this correctly.

Which Node.js version are you using?

22.11.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

@alvis
Copy link
Contributor
alvis commented Nov 20, 2024

I’m experiencing the same issue. @gluxon do you have any insights or suggestions? Thanks.

@gluxon gluxon self-assigned this Dec 1, 2024
@pitoniak32
Copy link

I am also seeing this issue when trying it get around the nestjs peer dependency issues :/

I was wondering if there are any updates / known workarounds for this?

@gluxon
Copy link
Member
gluxon commented Feb 24, 2025

Sorry for the delay everyone. I started taking a look today, but will need a bit more time for the fix.

zkochan pushed a commit that referenced this issue Mar 18, 2025
…9266)

* feat: return `workspace` for `resolvedVia`

* test: catalog protocol on injected deps

* refactor: create new `getCatalogReplacementPref` function

* refactor: pass through `resolvedVia` field to `ResolveDependencyResult`

* fix: replace `catalog:` protocol in injected workspace dependencies

---------

close #8715
@gluxon
Copy link
Member
gluxon commented Mar 23, 2025

🚢 v10.6.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0