更新到 Angular 6 后 [WDS] 加载后在 IE 上断开连接 [英] After update to Angular 6 [WDS] Disconnected on IE after load

查看:26
本文介绍了更新到 Angular 6 后 [WDS] 加载后在 IE 上断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的 Angular 项目从 5 更新到 6.但现在我在 Internet Explorer 11 上遇到了问题.每次我尝试在 localhost:4200 上加载实时开发服务器时,登录页面都会呈现,但会立即与实时开发服务器断开连接.

I updated my Angular Project from 5 to 6. But now I have issues with the Internet Explorer 11. Every time I try to load the live dev server on localhost:4200 the login page renders but immediatly disconnects from the live dev server.

所有其他浏览器都工作正常,控制台上没有错误(在 Edge、Firefox 和 Chrome 上尝试过)

All other Browsers work fine, no errors on the console (tried with Edge, Firefox and Chrome)

我的pollyfills看起来像这样:

My pollyfills look like this:

/**
 * This file includes polyfills needed by Angular and is loaded before the app.
 * You can add your own extra polyfills to this file.
 *
 * This file is divided into 2 sections:
 *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
 *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
 *      file.
 *
 * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
 * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
 * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
 *
 * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
 */

/***************************************************************************************************
 * BROWSER POLYFILLS
 */

/** IE9, IE10 and IE11 requires all of the following 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/weak-map';
import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js';  // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';


/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
import 'core-js/es7/reflect';


/**
 * Required to support Web Animations `@angular/platform-browser/animations`.
 * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
 **/
import 'web-animations-js';  // Run `npm install --save web-animations-js`.

/**
 * By default, zone.js will patch all possible macroTask and DomEvents
 * user can disable parts of macroTask/DomEvents patch by setting following flags
 */

// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames

/*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// (window as any).__Zone_enable_cross_context_check = true;

/***************************************************************************************************
 * Zone JS is required by default for Angular itself.
 */
import 'zone.js/dist/zone';  // Included with Angular CLI.



/***************************************************************************************************
 * APPLICATION IMPORTS
 */

和我的 package.json

and my package.json

{
  "name": "kwm",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.7",
    "@angular/cdk": "^6.3.1",
    "@angular/common": "^6.0.7",
    "@angular/compiler": "^6.0.7",
    "@angular/core": "^6.0.7",
    "@angular/forms": "^6.0.7",
    "@angular/http": "^6.0.7",
    "@angular/material": "^6.3.1",
    "@angular/platform-browser": "^6.0.7",
    "@angular/platform-browser-dynamic": "^6.0.7",
    "@angular/router": "^6.0.7",
    "@ngx-translate/core": "^10.0.2",
    "@ngx-translate/http-loader": "^3.0.1",
    "@swimlane/ngx-charts": "^8.1.0",
    "@swimlane/ngx-datatable": "^13.0.1",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.5.7",
    "hammerjs": "^2.0.8",
    "intl": "^1.2.5",
    "jquery": "^3.3.1",
    "moment": "^2.22.2",
    "ng2-completer": "^2.0.8",
    "ng2-semantic-ui": "^0.9.7",
    "ng4-click-outside": "^1.0.1",
    "ngx-bootstrap": "^3.0.1",
    "ngx-file-drop": "^4.0.6",
    "ngx-perfect-scrollbar": "^6.2.0",
    "ngx-popover": "^0.0.16",
    "rxjs": "^6.2.1",
    "rxjs-compat": "^6.2.1",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "~6.0.8",
    "@angular/compiler-cli": "^6.0.7",
    "@angular/language-service": "^6.0.7",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~10.5.1",
    "angular-2-dropdown-multiselect": "^1.8.0",
    "codelyzer": "^4.4.2",
    "jasmine-core": "~3.1.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^1.2.0",
    "protractor": "~5.3.2",
    "ts-node": "~7.0.0",
    "tslint": "~5.10.0",
    "typescript": "~2.7.2",
    "@angular-devkit/build-angular": "~0.6.8"
  }
}

我已经删除了 node_modules 文件夹和 package-lock.json 并进行了全新的 npm install

I already deleted the node_modules folder an package-lock.json and did a fresh npm install

推荐答案

我实际上是通过从 index.html 中删除一个未使用的脚本来修复它的,因为我试图重现该问题.不知道是什么真正导致了问题,因为它只在我升级到 Angular 6 并且之前一切正常之后才持续存在.

I actually fixed it by deleting a unused script from my index.html as I was trying to reproduce the issue. No idea what was actually causing the issue for it persisted only since I upgraded to Angular 6 and everything was fine before.

这篇关于更新到 Angular 6 后 [WDS] 加载后在 IE 上断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆