Skip to content

Unclear error message when a configuration is not present for a project #29742

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

Closed
1 task
tstackhouse opened this issue Mar 3, 2025 · 2 comments · Fixed by #29747
Closed
1 task

Unclear error message when a configuration is not present for a project #29742

tstackhouse opened this issue Mar 3, 2025 · 2 comments · Fixed by #29747
Labels

Comments

@tstackhouse
Copy link

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

This is a similar issue as reported in #29226.

When running a target, if a configuration isn't present, an error message is presented, as seen in the node architect host here. This is helpful, but especially when dealing with complex nested projects, the error message is not very helpful, as the project/target in question is not indicated.

This can be improved by changing that line as follows:

if (!targetDefinition.configurations?.[configuration]) {
  throw new Error(`Configuration '${configuration}' for target '${target}' in project '${project}' is not set in the workspace.`);
}

Minimal Reproduction

Attempt to run any comment for a project:target with a configuration that does not exist. The project and target are not indicated in the error message.

Exception or Error


Your Environment

n/a

Anything else relevant?

No response

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 4, 2025
…ion is mising

This commit makes the error message more actionable.

Closes angular#29742
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 4, 2025
…ion is mising

This commit makes the error message more actionable.

Closes angular#29742
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 4, 2025
…ion is missing

This commit makes the error message more actionable.

Closes angular#29742
alan-agius4 added a commit that referenced this issue Mar 4, 2025
…ion is missing

This commit makes the error message more actionable.

Closes #29742

(cherry picked from commit 6f0e90e)
@tstackhouse
Copy link
Author

Wow! Thanks for taking this on so quickly! Glad to help contribute to the community. I had filed this to submit a PR myself as a way to give back 😅

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants