New Angular app in Visual Studio, lots of JavaScript errors in polyfill.js

0

I have a new Angular app. If I run it using 'ng serve' then I don't appear to have any errors, if I run it within Visual Studio 2017 then I get lots of errors in the debug output window, e.g

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 137.0021ms 404 text/html; charset=utf-8
Exception was thrown at line 2584, column 55 in http://localhost:50055/polyfills.js
0x800a138f - JavaScript runtime error: Object.getPrototypeOf: 'this' is not an Object
Exception was thrown at line 2584, column 55 in http://localhost:50055/polyfills.js
0x800a138f - JavaScript runtime error: Object.keys: argument is not an Object
Exception was thrown at line 2584, column 55 in http://localhost:50055/polyfills.js
angular
asked on Stack Overflow Feb 21, 2019 by tony

2 Answers

0

This only happens when running in IE (yes, I have to support it), and only when Script debugging is enabled (Under the menu in the 'IIS Express' dropdown)

answered on Stack Overflow Feb 21, 2019 by tony
0

Uncomment the following lines in your polyfill.ts file (found in src/app)

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

answered on Stack Overflow May 21, 2019 by Crisp

User contributions licensed under CC BY-SA 3.0