Skip to content

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

Closed

Description

@tstackhouse

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

Activity

  1. added theissue type on Mar 4, 2025
  2. added
    freq1: low
    on Mar 4, 2025
  3. added 3 commits that reference this issue on Mar 4, 2025
    a6a9302
    5577d0d
    7665574
  4. added a commit that references this issue on Mar 4, 2025
    3ebd7ca
  5. added a commit that references this issue on Mar 4, 2025
    6f0e90e
  6. tstackhouse commented on Mar 4, 2025

    @tstackhouse
    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 😅

  7. angular-automatic-lock-bot commented on Apr 4, 2025

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular-devkit/architectfreq1: lowseverity2: inconvenienttype: bug/fix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions