【问题标题】:Angular 8 - Getting Runtime compiler not loaded errorAngular 8 - 未加载运行时编译器错误
【发布时间】:2021-02-03 19:39:19
【问题描述】:

我需要动态创建延迟加载的路由。当我使用导入语法时,例如loadChildren: () => import(`./pages/${module.moduleName}/${module.moduleName}.module`).then(m => m[childModuleName]), 它可以在 JIT 上运行,但是在 AOT 上运行时,会引发以下错误: ERROR Error: Uncaught (in promise): Error: Runtime compiler is not loaded 根据 https://github.com/angular/angular-cli/issues/10582 解决方案是使用旧的字符串语法: ```` loadChildren:./pages/${module.moduleName/${module.moduleName}.module#${childModuleName}

I get this error: 
``` ERROR Error: Uncaught (in promise): Error: Cannot find module './pages/client-migration/client-migration.module.ngfactory' ```

【问题讨论】:

    标签: javascript angular typescript lazy-loading


    【解决方案1】:

    将模块名称导入你的module.ts。

    【讨论】:

      猜你喜欢
      • 2019-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-25
      • 2017-07-27
      相关资源
      最近更新 更多