1

我在我的项目 app.routing.ts 中使用嵌套延迟加载

const routes: Routes = [
  { path: '', loadChildren: './user-panel/user-panel.module#UserPanelModule' },
];

export const Routing: ModuleWithProvidButers = RouterModule.forRoot(routes);

和我的 user-panel.routing.ts

const routes: Routes = [
  {
    path: '',
    component: UserPanelComponent,
    children: [
      { path: '', loadChildren: './pages/home/home.module#HomeModule' },
    ]
  }
];

export const Routing: ModuleWithProviders = RouterModule.forChild(routes);

但是当我使用子路由时,我收到了这个错误

ERROR RangeError: Maximum call stack size exceeded
4

1 回答 1

0

我建议您请遵循相同的:-

通过删除不必要的导入来解决。

此错误的原因是您有循环模块依赖问题。

例如:

'A' module imports (dependent to) 'B' module

'B' module imports (dependent to) 'A' module

我建议你构建一个公共模块,其他模块应该导入公共模块。

如果您有不必要的导入,请删除不必要的导入。

于 2019-05-17T10:53:38.787 回答