Skip to content

fix(core): disallow Vitest & Angular unit test runner when bundler is not esbuild in cnw#34023

Merged
leosvelperez merged 1 commit intomasterfrom
gh-34014
Jan 9, 2026
Merged

fix(core): disallow Vitest & Angular unit test runner when bundler is not esbuild in cnw#34023
leosvelperez merged 1 commit intomasterfrom
gh-34014

Conversation

@leosvelperez
Copy link
Member

Current Behavior

The create-nx-workspace incorrectly offers Vitest & Angular as a valid unit test runner choice when the bundler is something other than esbuild.

Expected Behavior

The create-nx-workspace should only offer Vitest & Angular as a valid unit test runner choice when the bundler is esbuild.

Related Issue(s)

Fixes #34014

@leosvelperez leosvelperez self-assigned this Jan 5, 2026
@leosvelperez leosvelperez requested a review from a team as a code owner January 5, 2026 16:42
@vercel
Copy link

vercel bot commented Jan 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Jan 9, 2026 4:00pm

@netlify
Copy link

netlify bot commented Jan 5, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit bdcaf99
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6961249ab257ce0008d11808
😎 Deploy Preview https://deploy-preview-34023--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.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 5, 2026

View your CI Pipeline Execution ↗ for commit bdcaf99

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 12m 51s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 37s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 12s 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-01-09 16:11:41 UTC

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ The fix from Nx Cloud was applied

These changes fix the TypeScript compilation error by adding a type assertion after the .filter(Boolean) call. TypeScript cannot infer that filtering removes null values, so we explicitly cast the result to Array<{ name: string; message: string }> to satisfy the type requirements for the choices property.

We had verified this fix by re-running create-nx-workspace:test.

Suggested Fix changes
diff --git a/packages/create-nx-workspace/bin/create-nx-workspace.ts b/packages/create-nx-workspace/bin/create-nx-workspace.ts
index ef146994cd..a23f151ffa 100644
--- a/packages/create-nx-workspace/bin/create-nx-workspace.ts
+++ b/packages/create-nx-workspace/bin/create-nx-workspace.ts
@@ -1314,7 +1314,7 @@ async function determineAngularOptions(
               name: 'none',
               message: 'None',
             },
-          ].filter(Boolean),
+          ].filter(Boolean) as Array<{ name: string; message: string }>,
           initial: 0,
         },
       ])

Revert fix via Nx Cloud  

View interactive diff ↗
This fix was applied by Leosvel Pérez Espinosa

🎓 Learn more about Self-Healing CI on nx.dev

Copy link
Member

@AgentEnder AgentEnder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a suggestion, but its a nit. I think its a bit nicer, but realistically it doesn't matter. Up to you 🤷‍♂️

@leosvelperez leosvelperez enabled auto-merge (squash) January 9, 2026 15:54
@leosvelperez leosvelperez merged commit cc5d173 into master Jan 9, 2026
20 checks passed
@leosvelperez leosvelperez deleted the gh-34014 branch January 9, 2026 16:11
FrozenPandaz pushed a commit that referenced this pull request Jan 14, 2026
…is not `esbuild` in cnw (#34023)

## Current Behavior

The `create-nx-workspace` incorrectly offers `Vitest & Angular` as a
valid unit test runner choice when the bundler is something other than
`esbuild`.

## Expected Behavior

The `create-nx-workspace` should only offer `Vitest & Angular` as a
valid unit test runner choice when the bundler is `esbuild`.

## Related Issue(s)

Fixes #34014

(cherry picked from commit cc5d173)
@github-actions
Copy link
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 Jan 15, 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.

Unable to create workspace with Vitest & Angular unit test runner

2 participants