-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Changed command fails when hotloaded with pnpm dlx in version 7 #3807
Comments
Hi @SF97 , thank you for reporting this issue. This appears to happen because However, it is still recommended to perform an install command before running any Lerna or Nx operations. Metadata generated from the install command is used to create a project graph with accurate dependencies. Because of this, just "hotloading" Nx or Lerna is not recommended. |
Hi @fahslaj Thank you very much for the reply and for the quick fix :) Thanks for the recommendation. I'll install the dependencies before running the Lerna changed command. But I guess it will be supported whenever Lerna upgrades NX to v16.7.2, even if not recommended. Would it be fine if I made a PR that upgrades to that NX version, but also adds a warning in the docs to mention the limitation? |
@SF97 Even though the Lerna repo is currently only on Nx 16.5.1, the Lerna package itself depends on a range of Nx: A PR to add a warning to the docs mentioning this limitation would be greatly appreciated! |
Closing this task since #3817 has been merged |
Current Behavior
I use "changed" command in a pnpm repo in CI/CD pipelines. It was working fine until version 6. But the command fails after upgrading to version 7 of Lerna
pnpm dlx lerna@7.0.0 changed --include-merged-tags --all --json
Output:
When using latest version, the error is exactly the same. Looks like it was introduced in version 7
When using the latest patch of version 6, everything works correctly:
pnpm dlx lerna@6.6.2 changed --include-merged-tags --all --json
Output:
Expected Behavior
Lerna 7 "changed" command should give the same exact output as version 6
Steps to Reproduce
Clone this repository: https://github.com/SF97/lerna-bug-demonstration
Run
pnpm dlx lerna@7.1.5 changed --include-merged-tags --all --json
at the root of the repositoryFailure Logs / Configuration
lerna.json
lerna-debug.log
0 silly argv { 0 silly argv _: [ 'changed' ], 0 silly argv 'include-merged-tags': true, 0 silly argv includeMergedTags: true, 0 silly argv all: true, 0 silly argv a: true, 0 silly argv json: true, 0 silly argv lernaVersion: '7.1.5', 0 silly argv '$0': '../../.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/lerna/dist/cli.js' 0 silly argv } 1 notice cli v7.1.5 2 verbose packageConfigs Explicit "packages" configuration found in lerna.json. Resolving packages using the configured glob(s): ["<redacted>"] 3 verbose rootPath /home/<redacted>/Desktop/<redacted> 4 error TypeError [ERR_INVALID_ARG_TYPE]: Failed to process the project graph with "nx-js-graph-plugin". 4 error The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined 4 error at writeFileSync (node:fs:2314:5) 4 error at writeLastProcessedLockfileHash (/home/<redacted>/.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/.pnpm/nx@16.7.0/node_modules/nx/src/plugins/js/index.js:53:28) 4 error at /home/<redacted>/.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/.pnpm/nx@16.7.0/node_modules/nx/src/plugins/js/index.js:26:17 4 error at Generator.next (<anonymous>) 4 error at /home/<redacted>/.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/.pnpm/tslib@2.6.1/node_modules/tslib/tslib.js:169:75 4 error at new Promise (<anonymous>) 4 error at Object.__awaiter (/home/<redacted>/.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/.pnpm/tslib@2.6.1/node_modules/tslib/tslib.js:165:16) 4 error at Object.processProjectGraph (/home/<redacted>/.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/.pnpm/nx@16.7.0/node_modules/nx/src/plugins/js/index.js:16:57) 4 error at /home/<redacted>/.local/share/pnpm/store/v3/tmp/dlx-126483/node_modules/.pnpm/nx@16.7.0/node_modules/nx/src/project-graph/build-project-graph.js:135:42
daemon.log
Environment
It started happening in CI/CD, but I was able to reproduce it locally
Additional information
This looks like an issue with NX, not with Lerna. I've reported here since Lerna is the one who triggered the issue for me, but I'm happy to move it to NX's repo if needed
When Lerna is a dependency of the project, and I the same command without dlx, it works correctly. Looks like its something related to hotloading the module
The text was updated successfully, but these errors were encountered: