Components: `ng generate @angular/material:navigation jnav` yields "... unhandled exception ..."

Created on 7 Feb 2020  Â·  10Comments  Â·  Source: angular/components

What am I doing wrong? According to my interpretation of Navigation schematic the following ng generate ... command should have worked.

PS rbeNgMat>  ng generate @angular/material:navigation jnav
An unhandled exception occurred: Schematic "navigation" not found in collection "@angular/material".
See "C:\Users\joeco\AppData\Local\Temp\ng-KACyoy\angular-errors.log" for further details.
PS rbeNgMat>

Thanks in advance.
Love and peace,
Joe
angular-errors.log

P2 needs clarification

Most helpful comment

Hi @Splaktar and @devversion ,
Thanks for the help.
So I got 3 things from this.

  1. The current docs are for Angular Material version 9
  2. The correct command for Angular Material version 8, looking it up on https://v8.material.angular.io/guide/schematics, is
    ng generate @angular/material:nav <component-name>
  3. The correct place for me to post this kind of issue is https://github.com/angular/components

I can report that this WORKED LIKE A CHAMP!

PS rbeNgMat> ng generate @angular/material:nav jnav
CREATE src/app/jnav/jnav.component.html (931 bytes)
CREATE src/app/jnav/jnav.component.spec.ts (1234 bytes)
CREATE src/app/jnav/jnav.component.ts (582 bytes)
CREATE src/app/jnav/jnav.component.css (193 bytes)
UPDATE src/app/app.module.ts (1045 bytes)
PS rbeNgMat>

Thanks SO MUCH.
Love and peace,
Joe

All 10 comments

This repository is for issues regarding Angular Material's documentation site. For general troubleshooting issues, I suggest you either submit a new issue on the angular/components repository or ask on StackOverflow.

Respectfully, Eric, I followed the documentation and it didn't work.

Can you please include the output of ng -v?

Please submit Angular Material and CDK questions here and issues here. This repo is for docs infrastructure only.

I've transferred this issue to the correct repository.

I looked into reproducing this, but wasn't able to. Based on the error being reported, it looks like an old version of the @angular/material is still installed. The schematic has been renamed to navigation from nav in v9. Can you please check if the latest version of Angular Material is used?

18433 reported the same issue but the issue explicitly mentioned Angular Material version 8 being used. For versions below v9, the schematic is named nav.

Hi Folks. I was in the middle of documenting the steps i took to generate the app when the issue was transferred & i lost my edit. I still suspect this may be a documentation issue because

  • v6 docs say
    ng generate @angular/material:material-nav --name <component-name>
  • current docs say ng generate@angular/material:navigation <component-name>

I'll append my app creation log at the end.
RE "Can you please include the output of ng -v"
The creation log says:

PS system32> ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.3.25
Node: 12.14.1
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.25
@angular-devkit/core         8.3.25
@angular-devkit/schematics   8.3.25
@schematics/angular          8.3.25
@schematics/update           0.803.25
rxjs                         6.4.0

Thanks for the help.
Love and peace,
Joe

appCreateLog.md.txt

You can find the Angular Material version 8 docs here:
https://v8.material.angular.io/guide/schematics#navigation-schematic

Hi @Splaktar and @devversion ,
Thanks for the help.
So I got 3 things from this.

  1. The current docs are for Angular Material version 9
  2. The correct command for Angular Material version 8, looking it up on https://v8.material.angular.io/guide/schematics, is
    ng generate @angular/material:nav <component-name>
  3. The correct place for me to post this kind of issue is https://github.com/angular/components

I can report that this WORKED LIKE A CHAMP!

PS rbeNgMat> ng generate @angular/material:nav jnav
CREATE src/app/jnav/jnav.component.html (931 bytes)
CREATE src/app/jnav/jnav.component.spec.ts (1234 bytes)
CREATE src/app/jnav/jnav.component.ts (582 bytes)
CREATE src/app/jnav/jnav.component.css (193 bytes)
UPDATE src/app/app.module.ts (1045 bytes)
PS rbeNgMat>

Thanks SO MUCH.
Love and peace,
Joe

@JoeCodeswell Awesome. Thanks for reporting back, and glad that it works now!.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dzrust picture dzrust  Â·  3Comments

Miiekeee picture Miiekeee  Â·  3Comments

MurhafSousli picture MurhafSousli  Â·  3Comments

3mp3ri0r picture 3mp3ri0r  Â·  3Comments

crutchcorn picture crutchcorn  Â·  3Comments