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

PNPM 9.5 Overrides problem on the auto generate package json for @nx/webpack:webpack #26884

Open
2 of 4 tasks
ZanchiStefano opened this issue Jul 10, 2024 · 2 comments
Open
2 of 4 tasks

Comments

@ZanchiStefano
Copy link

ZanchiStefano commented Jul 10, 2024

Current Behavior

During the migration from NX 19.0.8 to 19.4.2 and PNPM 8.15.7 to 9.5 we encountered the following problem.

Using PNPM 9.5 with the @nx/webpack:webpack and the flag generatePackageJson set to true, the generation of the package.json and the pnpm-lock.yaml are incorrect because of the overrides present in the lock but not in the package.

Because of that, when we try to generate the build for production with the following command pnpm i --prod --frozen-lockfile we obtain:

ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile

This problem appears even with a fresh installation.

Expected Behavior

The correct behaviour is that the package.json and the pnpm-lock.yaml are aligned and the command pnpm i --prod --frozen-lockfile will work just fine.

GitHub Repo

https://github.com/ZanchiStefano/nx-pnpm-error

Steps to Reproduce

With the repo linked:

  1. Clone the repo and install all the dependency
  2. Execute the command pnpm exec nx run nx-pnpm-error:build:production
  3. Look in the dist folder generated inside the folder apps/nx-pnpm-error

You can see there the anomaly of the package and pnpm lock.

Nx Report

Node   : 20.15.1
OS     : win32-x64
pnpm   : 9.5.0

nx                 : 19.4.2
@nx/js             : 19.4.2
@nx/jest           : 19.4.2
@nx/linter         : 19.4.2
@nx/eslint         : 19.4.2
@nx/workspace      : 19.4.2
@nx/devkit         : 19.4.2
@nx/eslint-plugin  : 19.4.2
@nx/nest           : 19.4.2
@nx/node           : 19.4.2
@nrwl/tao          : 19.4.2
@nx/web            : 19.4.2
@nx/webpack        : 19.4.2
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

9.5.0

Operating System

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

Additional Information

No response

@tiagovtristao
Copy link

We are also bumping into this problem, so just using pnpm install for now.

@ZanchiStefano
Copy link
Author

I updated the repo for the reproduction of the error to NX 19.5.7 and PNPM 9.7 to align it with the latest changes, the problem is still present.

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