-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): show better errors #29525
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
326d9b0
to
65466a2
Compare
View your CI Pipeline Execution ↗ for commit 9ed7de2.
☁️ Nx Cloud last updated this comment at |
65466a2
to
9ed7de2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I malformed the project.json
of cart
and these are the logs that I get:
Non Verbose:
~/p/nx-examples (master|✚4) [1]$ nx show projects
NX Failed to process project graph, there may be an issue with one of your Nx plugins. If the cause is not obvious from the error message, running "nx reset" may fix it. Please report the issue if you keep seeing it. See errors below.
- apps/cart/project.json: CommaExpected in /home/jason/projects/nx-examples/apps/cart/project.json at 7:3
5 | "projectType": "application",
6 | "generators": {}
> 7 | "targets": {
| ^^^^^^^^^
8 | "build": {
9 | "executor": "@nx/webpack:webpack",
10 | "options": {
- apps/cart/jest.config.ts: CommaExpected in apps/cart/project.json at 7:3
5 | "projectType": "application",
6 | "generators": {}
> 7 | "targets": {
| ^^^^^^^^^
8 | "build": {
9 | "executor": "@nx/webpack:webpack",
10 | "options": {
The projects in the following directories have no name provided:
- apps/cart
These logs are better than what it was before but they're still missing some information which would be helpful.
I think the plugin name or index would allow people to identify which plugin was causing the error... I almost feel like there's a line missing before the JSON error 🤔
readonly #partialProjectGraph: ProjectGraph; | ||
readonly #partialSourceMaps: ConfigurationSourceMaps; | ||
|
||
constructor( | ||
errors: Array< | ||
private readonly errors: Array< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows errors get serialized right?
error.message = `${ | ||
error.errors.length > 1 ? `${error.errors.length} errors` : 'An error' | ||
} occurred while processing files for the ${pluginName} plugin.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets overwritten
Current Behavior
Sub-errors are hidden when any project graph error is encountered. This is detrimental, as things like "missing comma in JSON" get hidden and make people think that Nx is broken, when in fact their config files are invalid.
Expected Behavior
Sub errors are shown regardless of verbose logging (but including their stack trace if verbose logging is enabled)
Without Verbose
With Verbose
Related Issue(s)
Fixes #