nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.17k stars 2.3k forks source link

the nx daemon fails to start when there is npm protocal dep with redirected resolve #26639

Closed franckchen closed 3 weeks ago

franckchen commented 2 months ago

Current Behavior

Once dependencies include npm protocol dependencies and resolve to other dep, nx throws an error and fails to start. even if after i install @typefox/monaco-editor-react dep. nx begine failed to start.

image

error message

The \"nx/js/dependencies-and-lockfile\" plugin threw an error while creating dependencies: \n Target project does not exist: npm:vscode@npm:@codingame/monaco-vscode-api@5.2.0

Expected Behavior

nx should work with npm protocal with redirect resolve. work with dep like @typefox/monaco-editor-react

GitHub Repo

No response

Steps to Reproduce

  1. install @typefox/monaco-editor-react
  2. vscode nx plugin fail to start
  3. All nx tasks fail to execute.

Nx Report

node:internal/process/promises:391
    triggerUncaughtException(err, true /* fromPromise */);
    ^

[Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
  The "nx/js/dependencies-and-lockfile" plugin threw an error while creating dependencies:
    Error: Target project does not exist: npm:vscode@npm:@codingame/monaco-vscode-api@5.2.0
        at validateCommonDependencyRules (/Users/chenfan/Documents/mycode/copilot-engine-cloud-front/node_modules/nx/src/project-graph/project-graph-builder.js:323:15)
        at validateDependency (/Users/chenfan/Documents/mycode/copilot-engine-cloud-front/node_modules/nx/src/project-graph/project-graph-builder.js:313:5)
        at /Users/chenfan/Documents/mycode/copilot-engine-cloud-front/node_modules/nx/src/plugins/js/lock-file/yarn-parser.js:214:80
        at Array.forEach (<anonymous>)
        at /Users/chenfan/Documents/mycode/copilot-engine-cloud-front/node_modules/nx/src/plugins/js/lock-file/yarn-parser.js:205:49
        at Array.forEach (<anonymous>)
        at /Users/chenfan/Documents/mycode/copilot-engine-cloud-front/node_modules/nx/src/plugins/js/lock-file/yarn-parser.js:203:72
        at Array.forEach (<anonymous>)
        at /Users/chenfan/Documents/mycode/copilot-engine-cloud-front/node_modules/nx/src/plugins/js/lock-file/yarn-parser.js:200:26
        at Array.forEach (<anonymous>)] {
  name: 'ProjectGraphError'
}

Node.js v22.3.0

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

Coly010 commented 1 month ago

Hi @franckchen

Can your provide a repo with a minimal reproduction of this issue?

There is simply not enough information currently for me to understand how to get a repo into a similar state to investigate this.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏