RangeError: Maximum call stack size exceeded Lazy routing Angular 2

后端 未结 7 864
礼貌的吻别
礼貌的吻别 2020-12-13 23:38

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.

7条回答
  •  不知归路
    2020-12-14 00:18

    Long story short: I met this error when didn't insert (forgot) child routes to the feature module:

    landings.routing.ts export const LandingsRoutes = RouterModule.forChild(routes);

    landings.module.ts

    imports: [
        CommonModule,
        // LandingsRoutes // <-- this I forgot and receive error Callstack exceeded
      ]
    

    If you don't export the routing module as a module - you need to export the only router with routes. Only forgotten things cause errors

提交回复
热议问题