Skip to content

Conversation

@mpsanchis
Copy link
Contributor

Current Behavior

If there are issues with values passed to generators via prompt, we still see a green output and exit code 0.

A colleague found out about this by pressing Ctrl+C when being prompted for parameters for a generator, and this led to the CLI simply continuing execution and showing no issue.

Expected Behavior

CLI fails.

@mpsanchis mpsanchis requested a review from a team as a code owner December 3, 2025 11:34
@netlify
Copy link

netlify bot commented Dec 3, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 21a14f0
@vercel
Copy link

vercel bot commented Dec 3, 2025

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

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 3, 2025 1:35pm
Comment on lines 926 to 930
`Could not properly parse prompts. Error:\n${JSON.stringify(
e,
null,
2
)}`
Copy link
Contributor

Choose a reason for hiding this comment

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

JSON.stringify() on Error objects returns "{}" because Error properties are not enumerable. This will hide the actual error details from users.

Fix by using the error message directly or converting to a plain object:

console.error( `Could not properly parse prompts. Error:\n${e.message || e}` );

Or to include stack trace:

console.error( `Could not properly parse prompts. Error:\n${e.stack || e.message || e}` );
Suggested change
`Could not properly parse prompts. Error:\n${JSON.stringify(
e,
null,
2
)}`
`Could not properly parse prompts. Error:\n${e.stack || e.message || e}`

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant