Skip to content

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

Closed

Description

@EvanCarroll

🐞 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

Activity

  1. 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[/+] on Jul 8, 2021
  2. added
    freq1: low
    on Jul 8, 2021
  3. added this to the Backlog milestone on Jul 8, 2021
  4. self-assigned this
    on Jun 30, 2022
  5. added 5 commits that reference this issue on Jun 30, 2022
    58671d3
    404383b
    6390944
    86e258d
    6f99294
  6. added 2 commits that reference this issue on Jul 8, 2022
    2500f34
    624e0b0
  7. angular-automatic-lock-bot commented on Aug 8, 2022

    @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 Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/clifreq1: lowseverity1: confusingtype: bug/fix

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions