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

Angular should error with the actual config problem if project's root is missing #21310

Closed
2 of 15 tasks
EvanCarroll opened this issue Jul 8, 2021 · 1 comment · Fixed by #23473
Closed
2 of 15 tasks
Assignees
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity1: confusing type: bug/fix
Milestone

Comments

@EvanCarroll
Copy link
Contributor

EvanCarroll commented Jul 8, 2021

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No, not that I know

Description

If you have more than two projects, and any project lacks root you will get the following error on ng generate

[error] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

🔬 Minimal Reproduction

Run ng g foo with the following

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "./projects",
  "defaultProject": "demo-app",
  "cli": {
    "packageManager": "npm"
  },
  "projects": {
    "demo-app": {},
    "bar": { root: "bar" }
  }
}

Note, either demo-app and bar must lack root, or both must lack root. If only one entry exists and it omits root then ng g will work as desired.

🔥 Exception or Error

An error not about and internal use of pathing.

🌍 Your Environment

Angular CLI: 12.1.1
Node: 14.17.3
Package Manager: <error>
OS: linux x64

Angular: 11.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.14
@angular-devkit/build-angular   0.1102.14
@angular-devkit/core            11.2.14
@angular-devkit/schematics      12.1.1
@angular/cli                    12.1.1
@schematics/angular             12.1.1
ng-packagr                      11.2.4
rxjs                            6.5.5
typescript                      4.0.8
@EvanCarroll EvanCarroll changed the title Angular should barf with the actual problem if project's root is missing. Angular should error with the actual config problem if project's root is missing Jul 8, 2021
@alan-agius4 alan-agius4 added area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity1: confusing type: bug/fix labels Jul 8, 2021
@ngbot ngbot bot added this to the Backlog milestone Jul 8, 2021
@alan-agius4 alan-agius4 self-assigned this Jun 30, 2022
@alan-agius4 alan-agius4 added the 2022Q3 Fixit Candidates for the Q3 2022 fix-it label Jun 30, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 30, 2022
…project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable error message when this is missing.

Closes: angular#21310
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 30, 2022
…project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable error message when this is missing.

Closes: angular#21310
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 7, 2022
…e project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable warning message when this is missing.

Note: this will become an error in the next major version.

Closes: angular#21310
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 7, 2022
…e project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable warning message when this is missing.

Note: this will become an error in the next major version.

Closes: angular#21310
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 7, 2022
…e project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable warning message when this is missing.

Note: this will become an error in the next major version.

Closes: angular#21310
alan-agius4 added a commit that referenced this issue Jul 8, 2022
…e project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable warning message when this is missing.

Note: this will become an error in the next major version.

Closes: #21310
(cherry picked from commit 624e0b0)
alan-agius4 added a commit that referenced this issue Jul 8, 2022
…e project has missing `root` property

The `root` property is required in a workspace project. Now we issue an actionable warning message when this is missing.

Note: this will become an error in the next major version.

Closes: #21310
@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 Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity1: confusing type: bug/fix
Projects
None yet
2 participants