Skip to content

fix(core): validate bundler option for Angular presets in create-nx-workspace#35074

Merged
jaysoo merged 1 commit into
masterfrom
NXC-4166
Mar 30, 2026
Merged

fix(core): validate bundler option for Angular presets in create-nx-workspace#35074
jaysoo merged 1 commit into
masterfrom
NXC-4166

Conversation

@jaysoo

@jaysoo jaysoo commented Mar 30, 2026

Copy link
Copy Markdown
Member

Current Behavior

When --bundler=vite is passed with an Angular preset (angular-monorepo or angular-standalone), yargs accepts it since --bundler is a shared type: 'string' option with no per-stack choices constraint. The invalid value flows through to the preset generator which rejects it after a full pnpm install (~25s), wasting the user's time.

Expected Behavior

Validate the bundler early in determineAngularOptions before any install starts. Invalid bundlers throw CnwError('INVALID_BUNDLER') so the error is:

  • Properly recorded via recordStat for telemetry
  • Surfaced as NDJSON for AI agents
  • Shown as a clear output.error() for interactive users

Valid Angular bundlers: esbuild, rspack, webpack.

Related Issue(s)

Fixes NXC-4166

@jaysoo jaysoo requested a review from a team as a code owner March 30, 2026 13:27
@jaysoo jaysoo requested a review from AgentEnder March 30, 2026 13:27
@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 11cd538
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69ca82a8559d560008a0ea0a
😎 Deploy Preview https://deploy-preview-35074--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 11cd538
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69ca82a86dea53000863d003
😎 Deploy Preview https://deploy-preview-35074--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 11cd538

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

☁️ Nx Cloud last updated this comment at 2026-03-30 14:12:43 UTC

…orkspace

## Current Behavior

When `--bundler=vite` is passed with an Angular preset, yargs accepts
it since `--bundler` is a shared string option. The invalid value flows
through to the preset generator which rejects it after a full pnpm
install, wasting ~25s of the user's time.

## Expected Behavior

Validate the bundler early in `determineAngularOptions` before any
install starts. Throws `CnwError('INVALID_BUNDLER')` so the error is
properly recorded via `recordStat` and surfaced as NDJSON for AI agents.

## Related Issue(s)

Fixes NXC-4166
@jaysoo jaysoo merged commit a309e31 into master Mar 30, 2026
24 checks passed
@jaysoo jaysoo deleted the NXC-4166 branch March 30, 2026 14:30
FrozenPandaz pushed a commit that referenced this pull request Mar 31, 2026
…orkspace (#35074)

## Current Behavior

When `--bundler=vite` is passed with an Angular preset
(`angular-monorepo` or `angular-standalone`), yargs accepts it since
`--bundler` is a shared `type: 'string'` option with no per-stack
`choices` constraint. The invalid value flows through to the preset
generator which rejects it after a full pnpm install (~25s), wasting the
user's time.

## Expected Behavior

Validate the bundler early in `determineAngularOptions` before any
install starts. Invalid bundlers throw `CnwError('INVALID_BUNDLER')` so
the error is:
- Properly recorded via `recordStat` for telemetry
- Surfaced as NDJSON for AI agents
- Shown as a clear `output.error()` for interactive users

Valid Angular bundlers: `esbuild`, `rspack`, `webpack`.

## Related Issue(s)

Fixes NXC-4166

(cherry picked from commit a309e31)
@github-actions

github-actions Bot commented Apr 5, 2026

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 Apr 5, 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.

2 participants