-
Notifications
You must be signed in to change notification settings - Fork 12k
materialNav schematics/collision in latest version #11632
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
Comments
Thanks for putting your fix in there, this was driving me crazy. |
I just had the same problem but sadly the suggested solution didn't work for me. Instead I moved the line 127: allNames.push(...aliases); outside, just after, the loop so it's now on line 128. Now everything works fine for me. |
Worked for me thanks :) |
in sources https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts line |
is there any workaround for this issue ? |
@thesayyn two workarounds have been already listed in this topic. read above |
I moved the line as suggested by @tomasvaedelund and it worked fine for me. |
I believe this was fixed by #11390, and the latest 6.1 RC should not have this problem. Please let me know if that's not the case so I can reopen. |
got it fixed. thank you @jayChrono |
thanks |
thanks bro, @jayChrono |
Thanks it worked for me. @jayChrono |
thnx @jayChrono |
Thanks all, what @tomasvaedelund said work fine for me. |
allNames.push(...aliases); to allNames.push(alias); at line 127, |
Changing allNames.push(...aliases); to allNames.push(aliases) worked for me. |
Angular CLI 6.1 has a fix for it.. try running ng update @angular/cli |
I changed the line 127 just like @jayChrono said and it worked. Thanks man!! |
what is line 127 please ? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular: 6.0.9
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 6.0.8
@angular/material 6.4.1
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.2
typescript 2.7.2
webpack 4.8.3
Repro steps
ng new my-app
npm install @angular/material @angular/cdk --save
npm install @angular/animations
ng generate @angular/material:material-nav --name test-nav
The log given by the failure
Schematics/alias "materialNav" collides with another alias or schematic name.
Error: Schematics/alias "materialNav" collides with another alias or schematic name.
at NodeModulesEngineHost.createCollectionDescription (C:\Users\Jay\git\my-resume\node_modules@angular-devkit\schematics\tools\file-system-engine-host-base.js:125:27)
at SchematicEngine._createCollectionDescription (C:\Users\Jay\git\my-resume\node_modules@angular-devkit\schematics\src\engine\engine.js:78:40)
at SchematicEngine.createCollection (C:\Users\Jay\git\my-resume\node_modules@angular-devkit\schematics\src\engine\engine.js:71:43)
at Object.getCollection (C:\Users\Jay\git\my-resume\node_modules@angular\cli\utilities\schematics.js:28:31)
at GenerateCommand.getOptions (C:\Users\Jay\git\my-resume\node_modules@angular\cli\models\schematic-command.js:193:41)
at GenerateCommand. (C:\Users\Jay\git\my-resume\node_modules@angular\cli\commands\generate.js:38:53)
at Generator.next ()
at C:\Users\Jay\git\my-resume\node_modules@angular\cli\commands\generate.js:7:71
at new Promise ()
at __awaiter (C:\Users\Jay\git\my-resume\node_modules@angular\cli\commands\generate.js:3:12)
Desired functionality
It should generate the component from the schematic without error.
Mention any other details that might be useful
I've traced it to line 127 in @angular-devkit/schematics/tools/file-system-host-base.js. The code 'allNames.push(...aliases);' appears to push the array ['material-nav', 'materialNav'] into allNames. Since it's in a for loop, the array gets pushed twice. I manually edited the line to 'allNames.push(alias);' and it generated the component as desired.
The text was updated successfully, but these errors were encountered: