nrwl/nx

pnpm support keeps breaking

mattfysh opened this issue · 1 comments

Current Behavior

it seems a lot of nx code, especially newer updates, keeps wanting to reach directly into node_modules to import transient deps (deps of deps)

pnpm does not allow you to do that (a good practice that npm must adopt), and so the pnpm support in nx keeps breaking because new nx releases keeps making this same mistake

Expected Behavior

pnpm should work, please when running your tests before release, create a new matrix dimension on package manager and run all the same tests using pnpm that you would for npm

GitHub Repo

No response

Steps to Reproduce

npx create-nx-workspace@latest myrepo --preset ts --ci skip --packageManager pnpm
cd myrepo
nx g lib foo --unitTestRunner none --bundler tsc

nx build foo
# ERROR: foo/src/index.ts:1:1 - error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.

nx lint foo
# ERROR: Daemon process terminated and closed the connection

Digging into daemon.log reveals the following error:

Error: The externalDependency 'eslint' for 'foo:lint' could not be found

Nx Report

Node   : 22.1.0
OS     : darwin-arm64
pnpm   : 9.1.0

nx (global)        : 19.0.1
nx                 : 19.0.2
@nx/js             : 19.0.2
@nx/eslint         : 19.0.2
@nx/workspace      : 19.0.2
@nx/eslint-plugin  : 19.0.2
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

wait, this is my bad, i had assumed that the support for pnpm v9 would have been part of the nx v19 release, considering that the PR was opened 3 weeks ago

it should be a priority for nx to keep up with the industry tooling, eslint v9 was released a month ago and prettier v3 was released 10 months ago, but nx has failed to keep up. it creates a sense that using nx is going hold you back as a developer, by pinning your monorepo to old versions of core tools