0

I am facing problem with working on Edge during the load of my dashboard (it is working on Chrome).
The page is not loaded, while it's loaded using different browser like Chrome.
The problem seems related to the following code ColorScale.js.pre-build-optimizer.js :

  /**
   * Setup color scale properties
   * @param {Object} props - The properties to initialize the color scale
   * @param {Array} props.colors - The array of colors
   */
  constructor(props) {
    props = {
      ...props
    };
    this.length = props.length || 15;
    this.colors = props.colors || this.generateColorMatrix(this.length);
  }

If I got the " ...props" is not compatible with IE or something like this.. The dashboard is launched in this way:

ng serve --host 0.0.0.0 --port 443 --public-host IP-ADDR --ssl --ssl-key /run/secrets/dashboard.key --ssl-cert /run/secrets/dashboard.cert --proxy-config server.js --prod

and it is based on the following modules:

{
  "name": "dash",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "export NODE_ENV=dev && ng serve --port 3000 --proxy-config server.js ",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/http": "^7.2.15",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@eds/vanilla": "^3.2.0",
    "body-parser": "^1.19.0",
    "core-js": "^2.5.4",
    "cors": "^2.8.5",
    "d3": "^5.12.0",
    "dragula": "^3.7.2",
    "express": "^4.17.1",
    "mapbox-gl": "^1.4.1",
    "microsoft-adal-angular6": "^1.3.0",
    "mongoose": "^5.7.5",
    "ng2-completer": "^3.0.2",
    "ng2-datepicker": "^3.1.1",
    "ng2-smart-table": "^1.5.0",
    "ngx-permissions": "^7.0.3",
    "nodemailer": "^6.3.1",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.9",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "rxjs-compat": "~6.5.3",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2"
  }
}

I put the following meta in the index.html page:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>My Dashboard</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">  
</head>
<body class="light">
  <app-root></app-root>  
</body>
</html>

The console output prints:

 HTML1300: Navigation occurred.    
 SCRIPT1028: SCRIPT1028: Expected identifier, string or number
main.a9b5b1da56328623fb36.js (1,2001685)

Is there anything related pre-build-optimizer files??? (See below) enter image description here

When this pre-build-optmizer is performed?

Prisco
  • 653
  • 1
  • 15
  • 30

1 Answers1

0

constructor() is es6 syntax which is not supported by IE 11. You need to add polyfill to make angular app compatible with IE 11. You could refer to this thread.

Besides, from the error message in console, it appears that you use webp image which is not supported by IE 11. You also need to use polyfill. You could use webp-hero to polyfill for rendering webp images in IE.

Yu Zhou
  • 11,532
  • 1
  • 8
  • 22
  • hi Yu, sorry but I didn't get how to fix the problem.. are you saying that in tsconfig.json I should change from es5 to es6, then I put polyfill in my code but it is not helping – Prisco Jan 17 '20 at 12:50
  • My problem is that the class that should be converted in some way belongs from a package I am using.. – Prisco Jan 17 '20 at 17:09