【问题标题】:IE 11 is throwing an error in console in angular 5IE 11 在 Angular 5 中的控制台中引发错误
【发布时间】:2018-01-09 19:37:50
【问题描述】:

我使用 MVC、VS 2015 创建了一个 Angular 4 应用程序。

当我在 chrome 上浏览应用程序时它工作正常,但在 IE 11 上它抛出以下异常:-

XHR error:  (404 Not Found) loading http://localhost/src/main.js
Instantiating http://localhost/src/main.js
Loading src/main.js

我的 tsconfing.json 是:-

{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es2015", "dom" ],
    "noImplicitAny": false,
    "suppressImplicitAnyIndexErrors": true,
    "noStrictGenericChecks": true,
    "skipLibCheck": true
  },
  "exclude": [
    "node_modules/*"
  ]
}

文件夹结构

src
->app folder
main.ts
system.config.js
tsconfig.js

如果您遇到类似问题,请告诉我。

【问题讨论】:

  • 你能把你的 pollyfill.ts 代码粘贴到这里吗?
  • @SandipJaiswal,我没有 pollyfill.ts 文件。
  • 可以在IE11中手动浏览http://localhost/src/main.js吗?
  • 2018年还支持IE有意义吗?
  • @Fenton,是的,我可以打开。

标签: angular typescript internet-explorer-11


【解决方案1】:

您必须取消注释 polyfill.ts 文件中的 polyfills IE 行,然后再次运行您的服务器

【讨论】:

    猜你喜欢
    • 2018-09-22
    • 1970-01-01
    • 2019-07-13
    • 2017-05-23
    • 2016-08-13
    • 1970-01-01
    • 1970-01-01
    • 2012-11-30
    • 2012-01-08
    相关资源
    最近更新 更多