components: Schematics: ng add throws startTag error
Bug:
Installing material using schematic with custom theme option throws error in Terminal.
Error:
Cannot read property 'startTag' of undefined
What is the expected behavior?
Material added with custom theme option configures app with material
What is the current behavior?
An error is thrown in Terminal.
What are the steps to reproduce?
-
Create a new app
ng new test-app --prefix=tst --style=scss
-
Install material
yarn add @angular/material
-
Run schematic
ng add @angular/material --theme=custom
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
MacBook Pro, Sierra 10.13.5 Chrome Version 67.0.3396.99
"@angular/core": "^6.0.3", // all angular deps
"@angular/cdk": "^6.3.2",
"@angular/material": "^6.3.2",
"@angular/cli": "~6.0.8"
"typescript": "~2.7.2",
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 22
- Comments: 35 (1 by maintainers)
Commits related to this issue
- fix(schematic): parse5 v5.0.0 requires different parse options (#12028) Fixes #12027 — committed to angular/components by jerryorta-dev 6 years ago
- fix(schematic): parse5 v5.0.0 requires different parse options (#12028) Fixes #12027 — committed to angular/components by jerryorta-dev 6 years ago
I used ng add @angular/material@6.2.1 it worked , it seems ng add @angular/material@6.3.1 have some problem that is latest one
If you don’t want to downgrade material and retain @angular/material@6.3.1, you can make the same edit in node_modules as in this PR just before you run the schematics.
I don’t have
node_modules/@angular/cli/schematics/utils
in my app what am I doing wrong, I have runng new test-app
and this folder above does not existThe fix by jerryorta-dev worked very well. You really need to modify the file
html.js
from the dirnode_modules/@angular/cli/schematics/utils
if you really need to use the latest version of Angular Material.@tobbyGithub Refer to my above comment