From ed4f297081dd41181776fd1203a83e3d9b19b534 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Mon, 23 Feb 2026 15:53:43 -0500 Subject: [PATCH] fix(bundling): add docs link to generatePackageJson error message ## Current Behavior When users hit the `generatePackageJson: true` error with TS Solution Setup, the error tells them to "unset the option" but gives no guidance on the replacement workflow. ## Expected Behavior The error message now includes a link to the pruning guide at https://nx.dev/docs/technologies/node/guides/deploying-node-projects so users can immediately find the migration steps. ## Related Issue(s) Fixes #30146 --- packages/esbuild/src/executors/esbuild/lib/normalize.ts | 2 +- packages/rollup/src/plugins/with-nx/with-nx.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/esbuild/src/executors/esbuild/lib/normalize.ts b/packages/esbuild/src/executors/esbuild/lib/normalize.ts index 32d6149b1e6..04649972973 100644 --- a/packages/esbuild/src/executors/esbuild/lib/normalize.ts +++ b/packages/esbuild/src/executors/esbuild/lib/normalize.ts @@ -17,7 +17,7 @@ export function normalizeOptions( const isTsSolutionSetup = isUsingTsSolutionSetup(); if (isTsSolutionSetup && options.generatePackageJson) { throw new Error( - `Setting 'generatePackageJson: true' is not supported with the current TypeScript setup. Update the 'package.json' file at the project root as needed and unset the 'generatePackageJson' option.` + `Setting 'generatePackageJson: true' is not supported with the current TypeScript setup. Update the 'package.json' file at the project root as needed and unset the 'generatePackageJson' option. See https://nx.dev/docs/technologies/node/guides/deploying-node-projects for the recommended pruned package.json workflow.` ); } diff --git a/packages/rollup/src/plugins/with-nx/with-nx.ts b/packages/rollup/src/plugins/with-nx/with-nx.ts index 47e95876f56..0de118d0265 100644 --- a/packages/rollup/src/plugins/with-nx/with-nx.ts +++ b/packages/rollup/src/plugins/with-nx/with-nx.ts @@ -220,7 +220,7 @@ export function withNx( if (isTsSolutionSetup) { if (options.generatePackageJson) { throw new Error( - `Setting 'generatePackageJson: true' is not supported with the current TypeScript setup. Update the 'package.json' file at the project root as needed and unset the 'generatePackageJson' option.` + `Setting 'generatePackageJson: true' is not supported with the current TypeScript setup. Update the 'package.json' file at the project root as needed and unset the 'generatePackageJson' option. See https://nx.dev/docs/technologies/node/guides/deploying-node-projects for the recommended pruned package.json workflow.` ); } if (options.generateExportsField) {