Skip to content

Generated components are misplaced in app.module.ts declarations list #7950

Closed
@RickePicke

Description

@RickePicke

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.1
node: 6.11.2
os: darwin x64
@angular/animations: 4.3.6
@angular/cdk: 2.0.0-beta.10-a7ce31e
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/material: 2.0.0-beta.10-a7ce31e
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.1
@angular/compiler-cli: 4.3.6
typescript: 2.2.2

Repro steps.

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 missing
    someComponentnt // <--- 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:

  create src/app/components/some/some.component.css (0 bytes)
  create src/app/components/some/some.component.html (35 bytes)
  create src/app/components/some/some.component.spec.ts (692 bytes)
  create src/app/components/some/some.component.ts (308 bytes)
  update src/app/app.module.ts (5810 bytes)

Desired functionality.

What causes this issue?
Is it a bug?

Mention any other details that might be useful.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions