简体   繁体   中英

New Angular CLI project fails on Internet Explorer

As of this morning, when I use the Angular CLI to create a new project it throws an exception on IE11 and returns this error message (in the console).

 SCRIPT5007: Unable to get property 'call' of undefined or null reference File: inline.bundle.js, Line: 55, Column: 12 

Yesterday it worked without error.

I am using

Angular CLI: 1.5.3
Node: 6.9.5
OS: win32 x64
Angular: 5.0.2

These are the steps I follow to create the project

ng new tempProject
cd tempProject\
npm install --save classlist.js
npm install --save web-animations-js

I then edit the polyfill.ts file and uncomment everything except for 'intl'. After that I use 'ng serve' and try to load it in IE. I have even deleted the node_modules directory and used npm install to recreate it. It works fine on chrome, of course. But I need to get it working on IE11 because it's the corporate standard where I work.

Every github issue talks about the polyfill file. But unless I'm supposed to add something to it that I don't know about, that doesn't help me. Anyone have any ideas?

It turned out that this was just Internet Explorer forgetting how to run javascript or something. Once I shut down IE, waited for it to really close (watch task manager to see for sure), and then started it up again it worked fine.

Please check your polyfills.js file and uncomment below lines of code and then try again.

And also update target in tsconfig.json : "target": "es5" ,

/** 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`.

/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM