I\'m trying to implement lazy routing into my app.
I have a very big project and when it was at router-deprecated I used AsyncRoute, but now it was removed.
I had the same error. I had four modules inside my angular app.
ERROR in Maximum call stack size exceeded
My Error
I had created a routing file inside a module manually and that file was not imported in module.ts file. So you need to import the routing file in your module.ts file.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UserLoginComponent } from './user-login/user-login.component';
import { UserSignupComponent } from './user-signup/user-signup.component';
import { PublicComponent } from './public/public.component';
import { PublicRoutingModule } from './public-routing.modue'; //import it first
@NgModule({
declarations: [UserLoginComponent, UserSignupComponent, PublicComponent],
imports: [
CommonModule,
PublicRoutingModule // I was missing this line
]
})
export class PublicModule { }
Alert: This module file is not app.module.ts