angular 5 show error while ng build --prod

During ng build --prod, I see the error occurs as:

Cannot determine the module for class AdminLoginComponent in /var/www/html/ngAngular/src/app/admin-login/admin-login.component.ts! Add AdminLoginComponent to the NgModule to fix it.

My app.module.ts is includes the below codes:

import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {HttpClientModule} from '@angular/common/http';
import {ReactiveFormsModule} from '@angular/forms';
import {AdminLoginComponent} from './admin/admin-login/admin-login.component';
import {LoginComponent} from './login/login.component';
import {AppComponent} from './app.component';
import {RegisterComponent} from './register/register.component';
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    PageNotFoundComponent,
    RegisterComponent,
    AdminLoginComponent
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    ReactiveFormsModule,
    AdminModule,
    AppRoutingModule
  ],
  providers: [AuthGuardService, AuthService],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Is anything I need to add to somewhere?

Upvotes: 0

Views: 296

Answers (1)

Arun Raj R
Arun Raj R

Reputation: 2317

You may have 2 components with the same name. So, can you remove or rename it and try again?

Upvotes: 1

Related Questions