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

Pruned lock file creation failed when using non-repo package #28767

Open
1 of 4 tasks
shprota opened this issue Nov 2, 2024 · 0 comments
Open
1 of 4 tasks

Pruned lock file creation failed when using non-repo package #28767

shprota opened this issue Nov 2, 2024 · 0 comments

Comments

@shprota
Copy link

shprota commented Nov 2, 2024

Current Behavior

Running nx run prune:build throws the following exception:

 NX   An error occured while creating pruned lockfile

Please open an issue at `https://github.com/nrwl/nx/issues/new?template=1-bug.yml` and provide a reproduction.
To prevent the build from breaking we are returning the root lock file.

Original error: Pruned lock file creation failed. The following package was not found in the root lock file: xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz


Error: Pruned lock file creation failed. The following package was not found in the root lock file: xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
    at /home/shprota/wwwroot/prune/node_modules/nx/src/plugins/js/lock-file/project-graph-pruning.js:44:19
    at Array.forEach (<anonymous>)
    at normalizeDependencies (/home/shprota/wwwroot/prune/node_modules/nx/src/plugins/js/lock-file/project-graph-pruning.js:30:42)
    at pruneProjectGraph (/home/shprota/wwwroot/prune/node_modules/nx/src/plugins/js/lock-file/project-graph-pruning.js:13:34)
    at createLockFile (/home/shprota/wwwroot/prune/node_modules/nx/src/plugins/js/lock-file/lock-file.js:163:79)
    at /home/shprota/wwwroot/prune/node_modules/@nx/webpack/src/plugins/generate-package-json-plugin.js:40:138
    at fn (/home/shprota/wwwroot/prune/node_modules/webpack/lib/Compilation.js:497:10)
    at _next0 (eval at create (/home/shprota/wwwroot/prune/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
    at eval (eval at create (/home/shprota/wwwroot/prune/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
    at Hook.eval [as callAsync] (eval at create (/home/shprota/wwwroot/prune/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)

Expected Behavior

No exception thrown

GitHub Repo

https://github.com/shprota/prune-lock-demo

Steps to Reproduce

  1. Clone the repo
  2. Install packages
  3. Run nx run prune:build
  4. See the error

Nx Report

NX Report complete - copy this into the issue template

Node : 22.10.0
OS : linux-x64
Native Target : x86_64-linux
yarn : 1.22.22

nx : 20.0.7
@nx/js : 20.0.7
@nx/jest : 20.0.7
@nx/eslint : 20.0.7
@nx/workspace : 20.0.7
@nx/devkit : 20.0.7
@nx/eslint-plugin : 20.0.7
@nx/nest : 20.0.7
@nx/node : 20.0.7
@nx/web : 20.0.7
@nx/webpack : 20.0.7
typescript : 5.5.4

Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

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

1 participant