Skip to content

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

Closed
@tstackhouse

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions