Angular 6 – IE 11 method fill not supported

You have created your angular app and now you have some error about method fill, for example: “Object doesn’t support property or method ‘fill'”.
Line that fail: var HEADER_FILLER = new Array(HEADER_OFFSET).fill(null); (Angular core).

Don’t worry the solution is easy. You must open your file on: src/polyfill.ts
At line 21 of the file you see:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/

and many “import ‘core-js/es6/BLABLA’” commented.

You must to uncomment all:

<br />
/** IE9, IE10 and IE11 requires all of the following polyfills. **/<br />
import 'core-js/es6/symbol';<br />
import 'core-js/es6/object';<br />
import 'core-js/es6/function';<br />
import 'core-js/es6/parse-int';<br />
import 'core-js/es6/parse-float';<br />
import 'core-js/es6/number';<br />
import 'core-js/es6/math';<br />
import 'core-js/es6/string';<br />
import 'core-js/es6/date';<br />
import 'core-js/es6/array';<br />
import 'core-js/es6/regexp';<br />
import 'core-js/es6/map';<br />
import 'core-js/es6/weak-map';<br />
import 'core-js/es6/set';<br />

Build and fun!

Leave a Reply

Your email address will not be published. Required fields are marked *