Skip to content

fix(js): trust exit code for pnpm >= 11 in release-publish executor#35580

Closed
comp615 wants to merge 1 commit into
nrwl:masterfrom
comp615:fix/release-publish-pnpm-11
Closed

fix(js): trust exit code for pnpm >= 11 in release-publish executor#35580
comp615 wants to merge 1 commit into
nrwl:masterfrom
comp615:fix/release-publish-pnpm-11

Conversation

@comp615

@comp615 comp615 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

nx release publish silently fails when the workspace uses pnpm 11+:

  • pnpm 11 reimplemented pnpm publish natively (feat!: replace npm publish with libnpmpublish pnpm/pnpm#10591). It no longer delegates to the npm CLI.
  • The new implementation accepts --json but writes nothing to stdout on success (the publish handler returns undefined; --json only suppresses the human-readable reporter).
  • release-publish.impl.ts runs the publish command and parses stdout via extractNpmPublishJsonData. With empty stdout the extractor returns { jsonData: null }, the executor logs "The pnpm publish output data could not be extracted" and returns success: false.
  • Combined with the default --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:

Expected Behavior

When pm === 'pnpm' and the detected pnpm major version is >= 11, trust the exit code: execSync already throws on non-zero exit, so reaching this branch means the publish succeeded. Print a minimal summary line and return { success: true }, matching the existing pm === 'bun' branch precedent (added in #34835).

This intentionally drops the verbose === Tarball Details === table for pnpm >= 11. Once pnpm restores --json stdout 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.

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>
@netlify

netlify Bot commented May 5, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9cd1b6a

@netlify

netlify Bot commented May 5, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9cd1b6a

@comp615

comp615 commented May 6, 2026

Copy link
Copy Markdown
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

@nx-cloud

nx-cloud Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 9cd1b6a

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ⛔ Cancelled 4m 2s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 17s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 24s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-06 17:49:47 UTC

@comp615 comp615 closed this May 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant