11

I have done all whatever mentioned in different posts over internet but my issue still persists.

I un-commented the polyfills required for IE 9, 10, 11

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

I applied meta tag in index.html

<meta http-equiv="X-UA-Compatible" content="IE=edge" >

But still i am getting errors while working in IE 11:

  • SCRIPT438: Object doesn't support property or method 'bind' runtime.js (208,11)

  • SCRIPT1010: Expected identifier polyfills.js (3846,36)

  • SCRIPT1010: Expected identifier styles.js (310,24)

  • SCRIPT1028: Expected identifier, string or number vendor.js (298,5)

  • SCRIPT1010: Expected identifier main.js (1424,32)

EDIT 1 Here is my tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2016",
      "dom"
    ],
    "paths": {
      "jszip": [
        "../node_modules/jszip/dist/jszip.min.js"
      ]
    }
  }
}

What should I do?

Any help would be highly appreciated.

TAB
  • 1,944
  • 8
  • 28
  • 45
  • 1
    Have you look at this?: https://github.com/angular/angular-cli/issues/11384 – Jacopo Sciampi Apr 12 '19 at 08:05
  • Yes, i have gone through that post but if you see someone still getting errors after doing so mentioned in that post. – TAB Apr 12 '19 at 08:10
  • Can't reproduce the problem on my side, I create a new Angular 7 project, it works well on my side. what you are doing will cause this error? can you post the Enough code to reproduce the problem as in [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – Zhi Lv Apr 15 '19 at 07:38
  • I am trying to create a small app with the issue and meanwhile I have added tsconfig.json settings. Could it be possible any related setting issue? – TAB Apr 15 '19 at 13:10
  • Hello there. Did you ever find an answer to this? I've met the same issue today, it seems that the problem occurs before polyfills are loaded. To reproduce the issue, one has to open IE, go to the dev tools (F12) and change Document Mode to IE8. – Elegie May 28 '19 at 12:28
  • @Elegie, I haven't found any solution yet. The solution mention here at https://github.com/angular/angular-cli/issues/11384 couldn't helped me. – TAB May 28 '19 at 13:09
  • 1
    @TAB Thanks for your answer. If I ever find something, I'll add a comment. Cheers. – Elegie May 28 '19 at 13:12
  • 1
    I have similar problem with it. Tried everything. Please answer. – Uland Nimblehoof Jun 07 '19 at 10:14
  • 1
    Yeah, still have same issue. Didn't found any solution yet. But as I found any workable solution, I will definitely post here. – TAB Jun 07 '19 at 11:30

2 Answers2

8

I solve this problem with below 4 steps ! for you, start from step3.

  1. Find polyfill.ts in your project

  2. Uncommented all commented import - save

  3. Install below npm

    • npm install --save classlist.js
    • npm install --save web-animations-js
  4. ng serve

credit : https://blog.angularindepth.com/angular-and-internet-explorer-5e59bb6fb4e9

++If you are using angular8 please refer to : https://stackoverflow.com/a/59317315/10109195

Energy
  • 940
  • 13
  • 20
  • 2
    I am still getting white screen even though I followed all the above steps. – Cpt Kitkat Jul 31 '19 at 10:12
  • 2
    Same. It's not exactly a polyfill issue for everyone. I've noticed some strange things in the router trace logs (enableTracing: true, in the router module's config)... IE seems to handle the base tag very differently than other browsers when it comes to relative pathing, and doesn't see query string params that follow the # in the url. – Ed Meacham Aug 06 '19 at 18:23
6

What about upgrading to angular v8 ?

Since the last major version the build process has been optimized for old browsers.

In Angular CLI version 8 and higher, applications are built using differential loading, a strategy where the CLI builds two separate bundles as part of your deployed application.

  • The first bundle contains modern ES2015 syntax, takes advantage of built-in support in modern browsers, ships less polyfills, and results in a smaller bundle size.

  • The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This results in a larger bundle size, but supports older browsers.

Development on IE

You should take a look at https://stackoverflow.com/a/56573079/4467001 to solve some issue on development mode and css since you upgraded angular to v8

Martin Choraine
  • 2,296
  • 3
  • 20
  • 37
  • I will give this a whirl and report back. Thanks Martin. – Ed Meacham Aug 07 '19 at 18:22
  • This did not solve the issue for us, but rather new issues arose. I have some more testing that I am going to do, and if I find a solution I will most certainly post here. Thanks again Martin. – Ed Meacham Aug 07 '19 at 22:05
  • 2
    Ok, FIXED! We had to not only upgrade to A8, but then change the tsconfig (as noted in the OP--specifically, "target": "es5") and we ended up having to set the deploy-url and base-href in our build command because the base tag in the index file was not being observed for an unknown reason. (https://shekhargulati.com/2017/07/06/angular-4-use-of-base-href-and-deploy-url-build-options/) – Ed Meacham Aug 08 '19 at 16:44
  • 2
    Great ! Sorry I would have precise it. Since angular 8 you have to add some config to use IE in development mode. But you find the solution – Martin Choraine Aug 08 '19 at 18:08
  • 2
    Yeah, our dev build was working great... the production build was the issue. Very happy to get a solution for this. Thanks again! – Ed Meacham Aug 08 '19 at 18:32
  • 1
    I will upgrade the app next week. And I hope, issue would be no more exists. – TAB Aug 09 '19 at 14:57