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

externalNodes incorrectly populated on pnpm@^9 #23108

Closed
1 of 4 tasks
DenizUgur opened this issue May 1, 2024 · 2 comments
Closed
1 of 4 tasks

externalNodes incorrectly populated on pnpm@^9 #23108

DenizUgur opened this issue May 1, 2024 · 2 comments

Comments

@DenizUgur
Copy link

DenizUgur commented May 1, 2024

Current Behavior

I've came across this issue while using @nx/dependency-checks eslint rule, where it failed to detect the dependencies in my source files. After debugging the linter I've realized that the actual problem is with how Nx parses pnpm lock file.

I've added a breakpoint on the following line to see how does this rule understands dependencies:

const externalDep = projectGraph.externalNodes[target];

It turns out it cannot match the discovered dependency with the ones extracted from lock file because the version is bundled with the package name. Which you can see in the following screenshot.

image

related #22247

Expected Behavior

I expect @nx/dependency-checks to work properly and tell me which dependencies are missing from my package.json file.

GitHub Repo

No response

Steps to Reproduce

  1. Install pnpm@^9 and run @nx/dependency-checks rule on a project
  2. Removing or adding dependencies in your source files shouldn't change the output of this eslint rule

Note

To me this seems like a very basic problem so I sincerely belive this should be easily reproducible. If not, let me know and I'll create a devbox for it.

Nx Report

Node   : 20.10.0
OS     : linux-x64
pnpm   : 9.1.0-0

nx (global)        : 18.3.4
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/cypress        : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/react          : 18.3.4
@nrwl/tao          : 18.3.4
@nx/vite           : 18.3.4
@nx/web            : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/vite/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Using pnpm@^8 is working fine

@DenizUgur DenizUgur changed the title externalNodes incorrectly populated on pnpm v9 externalNodes incorrectly populated on pnpm@^9 May 1, 2024
@AgentEnder
Copy link
Member

Closing this out as a duplicate of #22850, which is the tracking issue for pnpm 9 support.

Copy link

github-actions bot commented Jun 1, 2024

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants