Skip to content

Generate component does not add automatically to module #2379

Open
@danouche93

Description

@danouche93

Environment

{
  "name": "TinaAppV2",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@nativescript/angular": "^13.0.0",
    "@nativescript/core": "~8.2.2",
    "@nativescript/firebase": "^11.1.2",
    "@nativescript/firebase-core": "^1.0.0-alpha.36",
    "@nativescript/firebase-crashlytics": "^1.0.0-alpha.36",
    "@nativescript/firebase-database": "^1.0.0-alpha.36",
    "@nativescript/firebase-messaging": "^1.0.0-alpha.36",
    "@nativescript/mlkit-barcode-scanning": "^1.0.0-alpha.8",
    "@nativescript/mlkit-core": "^1.0.0-alpha.8",
    "@nativescript/theme": "~3.0.2",
    "@nstudio/nativescript-loading-indicator": "^4.1.2",
    "@nstudio/nativescript-pulltorefresh": "^3.0.2",
    "nativescript-ui-listview": "^10.1.1",
    "rxjs": "~7.5.0",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.0",
    "@angular/cli": "^13.3.6",
    "@angular/compiler-cli": "~13.2.0",
    "@nativescript/android": "8.2.2",
    "@nativescript/schematics": "^11.2.0",
    "@nativescript/types": "~8.2.0",
    "@nativescript/webpack": "~5.0.6",
    "@ngtools/webpack": "~13.2.0",
    "typescript": "~4.5.5"
  }
}

Nativescript : 8.2.3
Angular CLI: 10.1.1
Angular: 13.2.7

Describe the bug
When creating a new component using the command ng g c component-name, the component is successfully created but it is not added to app.module.ts. I always have to add the component in the module manually. I didn't have that problem with nativescript 6

To Reproduce
The commands I have tried :
ng generate component component-name
ng g c component-name
ng g c component-name --m app.module.ts
ng g c app.module.ts/component-name
ng g component component-name --module=app.module.ts
ng g c component-name -m app.module.ts
None of those commands add the component in the app.module after creating it

Expected behavior
The component is created and automatically added to declarations in app.module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions