简体   繁体   English

TypeError:无法在IE 10上获取未定义或空引用的属性'ngMetadataName'

[英]TypeError: Unable to get property 'ngMetadataName' of undefined or null reference on IE 10

In IE 10, I got the following error: (but OK in IE 11) 在IE 10中,出现以下错误:(但在IE 11中是正常的)

TypeError: Unable to get property 'ngMetadataName' of undefined or null reference TypeError:无法获取未定义或空引用的属性“ ngMetadataName”

The property ngMetadataName has been found in vendor.js . 属性ngMetadataName已在vendor.js找到。

The polyfills.ts is as the following: polyfills.ts如下:

  /******************************************************************************* 

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

/**

Web Animations @angular/platform-browser/animations
Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
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
*/

Can you please suggest how to resolve this for IE 10. 您能否建议如何解决IE 10的问题?

Thanks 谢谢

I have updated the angular-cli from 6.0.8 to 6.2.3 (Latest) and it solved the above error. 我已经将angular-cli从6.0.8更新为6.2.3(最新),它解决了上述错误。

This link github#24339 might be helpful. 此链接github#24339可能会有所帮助。

Thanks to @Suresh Kumar Ariya 感谢@Suresh Kumar Ariya

It is a problem with the components that needs to be declared in entryComponents . 这是需要在entryComponents中声明的组件的问题。 The angular ~7.2.2 upper version are broken these components. 有角的〜7.2.2上部版本破坏了这些组件。

  1. First of all, I recommend to remove all ^ and ~ to maintaining a stable application version. 首先,我建议删除所有^以维护稳定的应用程序版本。

  2. The stable version of angular 7 packages is 7.2.2 . angular 7软件包的稳定版本是7.2.2 So put version 7.2.2 for all @angular/package_name on package.json 因此将7.2.2版的所有@ angular / package_name放在package.json上

     "@angular/cli "7.2.2", "@angular/compiler "7.2.2", "@angular/compiler-cli "7.2.2", "@angular/language-service "7.2.2", 

将@ angular / cli(及相关程序包)升级到7.2.9或更高版本应该可以解决此问题。

npm install @angular/cli@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/language-service@latest

暂无
暂无

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

相关问题 IE 9和10上的JS错误 - 无法获取1个未定义或空引用的属性 - JS error on IE 9 and 10 - Unable to get property of 1 undefined or null reference IE 10 - 无法获取未定义或空引用的属性“PageRequestManager”: - IE 10 - Unable to get property 'PageRequestManager' of undefined or null reference: TypeError:无法获取未定义或空引用的属性“0” - TypeError: Unable to get property '0' of undefined or null reference 无法获取未定义或空引用IE的属性 - Unable to get property of undefined or null reference IE SCRIPT5007:无法在IE10中获取未定义或空引用的属性“值” - SCRIPT5007: Unable to get property 'value' of undefined or null reference in IE10 Angular 4错误TypeError:无法在IE中获取未定义或空引用的属性“应用” - Angular 4 ERROR TypeError: Unable to get property 'apply' of undefined or null reference in IE jQuery IE9-10:无法获取未定义或空引用的属性替换 - jQuery IE9-10: unable to get property replace of undefined or null reference 反应:TypeError:无法获取未定义或空引用的属性“处理程序” - React: TypeError: Unable to get property 'handler' of undefined or null reference 无法获取未定义或空引用的属性“top”(IE 11) - Unable to get property 'top' of undefined or null reference (IE 11) (IE9)无法获取未定义或空引用的属性'dispatchEvent' - (IE9)Unable to get property 'dispatchEvent' of undefined or null reference
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM