You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generated components are misplaced in app.module.ts declarations list #7950
I have over 25 components in my app and lately when I've runed ng g component some the generated components are misplaced in app.module declarations like this:
app.module.ts
@NgModule({declarations: [
...
anotherComponent,oneMoreCompone,// <--- nt is missingsomeComponentnt// <--- it's right here],
...
}
The log given by the failure.
There are no failure logs. This is logged when the component is generated though, as usual:
This happens all the time in the repo now, so it's a recurring problem. As I mentioned, I have a lot of imports and a lots of declarations in my app.module.ts.
changed the title [-]Generated components are misplaced in app.module.ts declarations[/-][+]Generated components are misplaced in app.module.ts-declarations[/+]on Oct 5, 2017
changed the title [-]Generated components are misplaced in app.module.ts-declarations[/-][+]Generated components are misplaced in app.module.ts - > declarations[/+]on Oct 5, 2017
changed the title [-]Generated components are misplaced in app.module.ts - > declarations[/-][+]Generated components are misplaced in app.module.ts -> declarations[/+]on Oct 5, 2017
changed the title [-]Generated components are misplaced in app.module.ts -> declarations[/-][+]Generated components are misplaced in app.module.ts declarations list[/+]on Oct 5, 2017
I'm using VS-code on mac. Tried some more times having the file closed and open with and without changes. The result this time was this:
app.module.ts
@NgModule({declarations: [
...
TemplateBuilder,// <--- "Component" moved from hereTestComponent,Test2Component,Test3Component,Test4ComponentComponent// <--- to here, one step at the time],
...
}
I'm getting same issue using:
VS Code v-1.17.1,
OS Windows 7,
@angular/core": "^4.4.5",
@angular/cli": "^1.4.7",
@angular/compiler-cli": "^4.4.5
Running "ng g c component-name" the previous created component path and name is truncated in app.module.ts file triggering an error during compilation.
Activity
[-]Generated components are misplaced in app.module.ts declarations[/-][+]Generated components are misplaced in app.module.ts-declarations[/+][-]Generated components are misplaced in app.module.ts-declarations[/-][+]Generated components are misplaced in app.module.ts - > declarations[/+][-]Generated components are misplaced in app.module.ts - > declarations[/-][+]Generated components are misplaced in app.module.ts -> declarations[/+][-]Generated components are misplaced in app.module.ts -> declarations[/-][+]Generated components are misplaced in app.module.ts declarations list[/+]hansl commentedon Oct 11, 2017
Could you share the whole file? I'm generating a 1000 components here and I don't see it. We use AST so it's robust, unless:
What editor are you using?
RickePicke commentedon Oct 15, 2017
I'm using VS-code on mac. Tried some more times having the file closed and open with and without changes. The result this time was this:
app.module.ts
orestes-garcia-martinez commentedon Oct 16, 2017
I'm getting same issue using:
VS Code v-1.17.1,
OS Windows 7,
@angular/core": "^4.4.5",
@angular/cli": "^1.4.7",
@angular/compiler-cli": "^4.4.5
Running "ng g c component-name" the previous created component path and name is truncated in app.module.ts file triggering an error during compilation.
terminal output:

app.module.ts file :

fix(@angular-devkit/schematics): fix `generate` mangling files contai…
fix(@angular-devkit/schematics): fix `generate` mangling files contai…
fix(@angular-devkit/schematics): fix `generate` mangling files contai…
updating angular cli to my fork (#1)
angular-automatic-lock-bot commentedon Sep 8, 2019
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.