fix(js): trust exit code for pnpm >= 11 in release-publish executor#35580
Draft
comp615 wants to merge 1 commit intonrwl:masterfrom
Draft
fix(js): trust exit code for pnpm >= 11 in release-publish executor#35580comp615 wants to merge 1 commit intonrwl:masterfrom
comp615 wants to merge 1 commit intonrwl:masterfrom
Conversation
pnpm 11 reimplemented `pnpm publish` natively (pnpm/pnpm#10591), and the new implementation accepts `--json` but writes nothing to stdout on success. As a result, `extractNpmPublishJsonData` always returns `{ jsonData: null }` and the executor incorrectly reports a successful publish as failed. Combined with `--nx-bail=true`, this silently aborts the rest of a release: tarballs reach the registry, but Nx marks the task failed and skips the remaining packages. Until pnpm restores `--json` stdout output (tracked at pnpm/pnpm#11476), short-circuit on `pm === 'pnpm' && major >= 11` and trust the exit code, mirroring the existing `pm === 'bun'` branch. `execSync` already throws on non-zero exit, so reaching the new branch means the publish succeeded. Refs: nrwl#35575 Refs: pnpm/pnpm#11476 Refs: pnpm/pnpm#10591 (official workaround: `pnpm pack && npm publish *.tgz`) Amp-Thread-ID: https://ampcode.com/threads/T-019df90f-8f75-763f-b528-4602e870a972 Co-authored-by: Amp <amp@ampcode.com>
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
This was referenced May 5, 2026
Contributor
Author
|
I think since the pnpm fix got in so quick, we might be able to avoid this and just have some pnpm versions that don't work |
Contributor
|
View your CI Pipeline Execution ↗ for commit 9cd1b6a
☁️ Nx Cloud last updated this comment at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
nx release publishsilently fails when the workspace uses pnpm 11+:pnpm publishnatively (feat!: replacenpm publishwithlibnpmpublishpnpm/pnpm#10591). It no longer delegates to the npm CLI.--jsonbut writes nothing to stdout on success (the publish handler returnsundefined;--jsononly suppresses the human-readable reporter).release-publish.impl.tsruns the publish command and parses stdout viaextractNpmPublishJsonData. With empty stdout the extractor returns{ jsonData: null }, the executor logs "The pnpm publish output data could not be extracted" and returnssuccess: false.--nx-bail=true, this aborts the rest of a release after the first parallel batch: tarballs reach the registry for the packages that were attempted, but Nx marks the task failed and skips the remaining packages. Releases look "passed" in CI but are partial.Tracked at:
pnpm publish --json produces empty stdout in pnpm 11 (regression from pnpm 10)Expected Behavior
When
pm === 'pnpm'and the detected pnpm major version is>= 11, trust the exit code:execSyncalready throws on non-zero exit, so reaching this branch means the publish succeeded. Print a minimal summary line and return{ success: true }, matching the existingpm === 'bun'branch precedent (added in #34835).This intentionally drops the verbose
=== Tarball Details ===table for pnpm >= 11. Once pnpm restores--jsonstdout output (pnpm/pnpm#11476), the JSON extraction path will succeed again and this short-circuit becomes a no-op that can be removed.The official pnpm-side workaround for users who need the npm-CLI semantics today is
pnpm pack && npm publish *.tgz(documented in the changeset for pnpm/pnpm#10591).Verification of no duplicate PRs
Before opening, I searched open Nx PRs for
extract-npm-publish-json-data,release-publish.impl, and#35575— no open PRs touch this code path.Related Issue(s)
Refs #35575
Refs pnpm/pnpm#11476
Refs pnpm/pnpm#10591
🤖 Authored with assistance from Amp.