0

So this persistent problem in Angular Nativesript environment where I have declared component in only auth.module.tns.ts files.

The error:

Error: Type LoginComponent is part of the declarations of 2 modules: AuthModule and AuthModule! Please consider moving LoginComponent to a higher module that imports AuthModule and AuthModule. You can also create a new NgModule that exports and includes LoginComponent then import that NgModule in AuthModule and AuthModule. 

auth.module.ts file:

import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';

import {AuthRoutingModule} from '../../views/auth/auth-routing.module';

@NgModule({
  declarations: [],
  imports: [
    CommonModule,
    AuthRoutingModule
  ]
})
export class AuthModule {
}

auth.module.tns.ts file:

import {NgModule, NO_ERRORS_SCHEMA} from '@angular/core';
import {NativeScriptCommonModule} from 'nativescript-angular/common';

import {AuthRoutingModule} from '../../views/auth/auth-routing.module';
import {LoginComponent} from '@src/app/views/auth/login/login.component';
import {SignupComponent} from '@src/app/views/auth/signup/signup.component';


@NgModule({
  declarations: [
    LoginComponent,
    SignupComponent
  ],
  imports: [
    AuthRoutingModule,
    NativeScriptCommonModule,
  ],
  exports: [],
  schemas: [NO_ERRORS_SCHEMA]
})
export class AuthModule {
}

Any suggestions on what the cause might be?

Prajil Shrestha
  • 124
  • 1
  • 9

0 Answers0