Skip to content
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

ng build and ng serve with --project should clearly indicate that a project is unrecognized #17682

Closed
2 of 15 tasks
lonerzzz opened this issue May 9, 2020 · 1 comment · Fixed by #17922
Closed
2 of 15 tasks
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely help wanted severity1: confusing type: bug/fix
Milestone

Comments

@lonerzzz
Copy link

lonerzzz commented May 9, 2020

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Suspect that this problem has existed from day one.

Description

When running 'ng build --project ' or 'ng serve --project ', the command gives a misleading error if the project name is not recognized. In the following example, 'Typo' is a project that has not even been created.

ng build --project Typo
An unhandled exception occurred: Project 'Typo' does not support the 'build' target.
See "C:\Users\Jason\AppData\Local\Temp\ng-nSmh2j\angular-errors.log" for further details.

Nothing about the error indicates that 'Typo' could not be found in the angular.json file and so starts a wild goose chase. I have been bitten by this twice at separate times when I have stepped away from the tools for a bit. A simple typo in the name of the project is enough to send one looking in the json file for errors when that is not the problem.

🔬 Minimal Reproduction

See above in the description.

🔥 Exception or Error

See above description

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.1.5
Node: 10.13.0
OS: win32 x64

Angular: 9.1.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.5
@angular-devkit/build-angular      0.901.5
@angular-devkit/build-ng-packagr   0.901.5
@angular-devkit/build-optimizer    0.901.5@angular-devkit/build-webpack      0.901.5
@angular-devkit/core               9.1.5
@angular-devkit/schematics         9.1.5
@angular/cli                       9.1.5
@ngtools/webpack                   9.1.5
@schematics/angular                9.1.5
@schematics/update                 0.901.5
ng-packagr                         9.1.3
rxjs                               6.5.5
typescript                         3.8.3
webpack                            4.42.0

Anything else relevant?
Nope

@ngbot ngbot bot added this to the needsTriage milestone May 9, 2020
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity1: confusing type: bug/fix labels May 9, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog May 9, 2020
kgajera added a commit to kgajera/angular-cli that referenced this issue Jun 12, 2020
The current error message is misleading because it seems like the project exists but the target is not supported.

Closes angular#17682
kgajera added a commit to kgajera/angular-cli that referenced this issue Jun 15, 2020
Currently this falls through to a misleading error for an unsupported build target.

Closes angular#17682
kgajera added a commit to kgajera/angular-cli that referenced this issue Jun 15, 2020
Currently this falls through to a misleading error for an unsupported build target.

Closes angular#17682
alan-agius4 pushed a commit that referenced this issue Jun 16, 2020
Currently this falls through to a misleading error for an unsupported build target.

Closes #17682
alan-agius4 pushed a commit that referenced this issue Jun 16, 2020
Currently this falls through to a misleading error for an unsupported build target.

Closes #17682

(cherry picked from commit ba0f7ac)
@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 Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely help wanted severity1: confusing type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants