Skip to content

Conversation

sudo-elia
Copy link

I have updated all instances of:

throw new Error(`Project ${projectName} not found!`);

to

throw new Error(`Project ${projectName} not found in angular.json.`);

because my team and I (due to our own oversight in not reading the documentation) had difficulty, as we thought we needed to use the property name in webconfig instead of the project name.
So, I’m suggesting this change to make the error message more descriptive, which could save time for others in the future (if you agree).

@manfredsteyer
Copy link
Contributor

manfredsteyer commented Oct 8, 2025

Good idea. Perhaps we should write angular.json or project.json because Nx uses the latter one.


if (!projectConfig) {
throw new Error(`Project ${projectName} not found!`);
throw new Error(`Project ${projectName} not found in angular.json.`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
throw new Error(`Project ${projectName} not found in angular.json.`);
throw new Error(`Project ${projectName} not found in Angular workspace (angular.json or project.json).`);


if (!projectConfig) {
throw new Error(`Project ${projectName} not found!`);
throw new Error(`Project ${projectName} not found in angular.json.`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
throw new Error(`Project ${projectName} not found in angular.json.`);
throw new Error(`Project ${projectName} not found in Angular workspace (angular.json or project.json).`);


if (!projectConfig) {
throw new Error(`Project ${projectName} not found!`);
throw new Error(`Project ${projectName} not found in angular.json.`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
throw new Error(`Project ${projectName} not found in angular.json.`);
throw new Error(`Project ${projectName} not found in Angular workspace (angular.json or project.json).`);


if (!projectConfig) {
throw new Error(`Project ${projectName} not found!`);
throw new Error(`Project ${projectName} not found in angular.json.`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
throw new Error(`Project ${projectName} not found in angular.json.`);
throw new Error(`Project ${projectName} not found in Angular workspace (angular.json or project.json).`);


if (!projectConfig) {
throw new Error(`Project ${projectName} not found!`);
throw new Error(`Project ${projectName} not found in angular.json.`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
throw new Error(`Project ${projectName} not found in angular.json.`);
throw new Error(`Project ${projectName} not found in Angular workspace (angular.json or project.json).`);

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

Successfully merging this pull request may close these issues.

3 participants