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",
Same error
Same error
is there solution for this error , i am having the same one
Same error
I used ng add @angular/[email protected] it worked , it seems ng add @angular/[email protected] have some problem that is latest one
If you don't want to downgrade material and retain @angular/[email protected], you can make the same edit in node_modules as in this PR just before you run the schematics.
The fix by jerryorta-dev worked very well. You really need to modify the file html.js from the dir node_modules/@angular/cli/schematics/utils if you really need to use the latest version of Angular Material.
I don't have node_modules/@angular/cli/schematics/utils in my app what am I doing wrong, I have run ng new test-app and this folder above does not exist
the correct path is : \node_modules@angular\material\schematics\utils\html.js
@jerryorta-dev that fix worked! I'm including material as part of a schematic and this was needed to get it to work. hopefully, it goes in soon
same error
Same Error. Also find when generate schematics, dashboard and sidenav have wrong align
The same here on Windows and cli version 6.0.8.
Uninstall the @angular/material and reinstall...
Use solution by @jerryorta-dev, works as a charm! (Mine: Angular/Cli 6.0.8, Node 10.1.0, Linux Mint 18.3 x64)
I am not able to find html.ts file. Should i create and add the file directly?
@addyfreek, in your folder you maybe has an html.js file instead of a .ts one, that's the file you need to change, is the one i change, so try it and hope that's work for you.
Same error
Hi, as I commented on Github, you need to modify a file called html.js, because there's a chance that the html.ts is not in your folder structure or is not part of your environment. Hope that's work for you.
El sáb., 7 jul. 2018 a las 10:16, Aditya Ramanathan (< [email protected]>) escribió:
I am not able to find html.ts file. Should i create and add the file directly?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/material2/issues/12027#issuecomment-403198093, or mute the thread https://github.com/notifications/unsubscribe-auth/AYNCh7jSGTBWwXGNBNuAY5kyUYC97eVuks5uEG5HgaJpZM4VARpg .
Same error