【问题标题】:Lazy Loaded Module not loaded in IE11IE11 中未加载延迟加载模块
【发布时间】:2019-09-04 14:50:48
【问题描述】:

我的 Angular 7 应用程序有两个模块 txxxxx 模块和配置模块。这两个模块都是从 App Routing Module 延迟加载的。问题是,当我尝试导航到配置模块时,它会抛出一个错误,提示“加载块组件-配置-配置-模块失败。”。此错误仅在 Internet Explorer 中出现,在 Edge、Chrome、Safari 和 Firefox 中运行正常。

这些是我已经尝试过的东西:

  1. 我在 polyfills 中添加了这些文件,但它没有 解决我的错误。

import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
  1. 我在 index.ts 中添加了以下行,但没有解决我的错误:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

我的应用路由模块是这样的:

const routes: Routes = [{
    path: '',
    pathMatch: 'full',
    redirectTo: 'trends'
  },
  {
    path: 'txxxxx',
    canActivate: [AuthGuardService],
    loadChildren: './components/txxxxxx/txxxxx-ixxxxxx.module#Txxxxxxxxxxxxxxxxxx'
  },
  {
    path: 'configuration',
    canActivate: [AuthGuardService],
    loadChildren: './components/configuration/configuration.module#ConfigurationModule'
  }
];

在 IE 上抛出的错误是:

【问题讨论】:

    标签: javascript angular typescript webpack


    【解决方案1】:

    这可能会有所帮助: 我的问题只有当我打开某些路线时,问题才会出现,我发现我使用 CKEditor 的路线是造成该异常的原因,当我用文本区域替换它时,异常消失了,我很高兴我正在使用CK 编辑器在

    检查github ticket

    【讨论】:

      猜你喜欢
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 2017-02-22
      • 1970-01-01
      • 1970-01-01
      • 2018-09-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多