简体   繁体   English

Angular 6 网站不能在 IE 上运行,但可以在所有浏览器上本地运行

[英]Angular 6 website not working on IE but works locally on all browsers

  • Angular 6 website Angular 6 网站
  • VMware virtual machine environment VMware虚拟机环境
  • Windows Server 2012 R2 Standard server Windows Server 2012 R2 标准服务器

I have an angular website working fine in chrome browser (all versions) on my laptop我的笔记本电脑上的 chrome 浏览器(所有版本)中有一个 angular 网站可以正常工作

  • Same angular website works fine in IE in my laptop (all versions) in my laptop相同的角度网站在我的笔记本电脑(所有版本)中的 IE 中运行良好
  • But when i deploy this in client server, virtual machine, chrome website works fine但是当我在客户端服务器、虚拟机、chrome 网站中部署它时工作正常
  • But IE website give white blank page for all versions (all VMs in the data center)但是IE网站为所有版本(数据中心的所有VM)提供白色空白页面
  • There is no errors in console nor warnings控制台中没有错误也没有警告
  • relevant polyfills.ts lines are uncommented相关的 polyfills.ts 行未注释

I changed the mode of IE to compatibility and observed following errors in console:我将 IE 的模式更改为兼容性并在控制台中观察到以下错误:

SCRIPT5009: 'Promise' is undefined
jspdf.min.js (118,654)
SCRIPT1002: Syntax error
main.js (8527,59)
SCRIPT5011: Can't execute code from a freed script
zone.js (2775,1)

To get Angular App working on IE, go to polyfills.ts and uncomment the following要让 Angular App 在 IE 上运行,请转到 polyfills.ts 并取消注释以下内容

/** 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';

This is a known bug relating to zone.js and the IE Developer Tools.这是与 zone.js 和 IE 开发人员工具相关的已知错误。 https://github.com/angular/angular/issues/31723 https://github.com/angular/angular/issues/31723

The development workaround is to add this flag before loading zone.js开发解决方法是在加载 zone.js 之前添加此标志

(window as any).__Zone_enable_cross_context_check = true;
import 'zone.js/dist/zone';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular 7 openlayers 项目适用于除 edge 和 ie 之外的所有浏览器 - Angular 7 openlayers project works with all browsers except edge and ie Angular 7 应用程序在 IE 11 中出现错误,并且在所有其他浏览器中都可以正常工作 - Angular 7 application gives error in IE 11 and works fine in all other browsers 单击事件在 IE 中不起作用,但在其他浏览器中工作正常 - Click event is not working in IE but works fine in other browsers Angular 网站无法在 Frefox 和 Safari 等不同浏览器上运行 - Angular website not working on different browsers like Frefox and Safari Angular 应用程序在本地使用 IE11,但在托管在 IIS 上时不能 - Angular application working with IE11 locally but not when hosted on IIS Angular Swimlane Ngx 图表在 stackblitz 中无法在本地工作 - Angular Swimlane Ngx chart not working locally which works in stackblitz IE11 使用 blob 保存 angular 中损坏的下载的.xlsx 文件(在本地工作) - IE11 saves downloaded .xlsx files corrupted in angular using blob (works locally) Angular 应用可以在本地运行,但不能在 Firebase 上运行 - Angular app works locally but not on Firebase Angular 在 IE 和智能电视浏览器中不起作用 - Angular does not work in IE and smart tv browsers 基本的Angular应用程序在本地无法在heroku上运行-出现H10崩溃错误 - basic Angular app works locally not working on heroku - getting H10 crashing error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM