internet-explorer-11angular9ng-idle

Vendor.js throwing syntax error for ng-idle library for IE 11


Getting syntax error in vendor.js file while running angular 9 application in IE 11. I've enabled all the polyfills and changed the target to "es5" in tsconfig.json as well.

any help will be appreciated!

package.json

    "@angular/core": "~9.0.5",
    "@angular/platform-browser": "~9.0.5",
    "@ng-idle/core": "^10.0.0-beta.1",
    "@ng-idle/keepalive": "^10.0.0-beta.1",
    "classlist.js": "1.1.20150312",
    "core-js": "^3.8.2",    
    "zone.js": "^0.10.3"
    "typescript": "~3.7.5"

tsconfig.json

{
    "compileOnSave": false,
    "compilerOptions": {
        "baseUrl": "./",
        "outDir": "./dist/out-tsc",
        "sourceMap": true,
        "declaration": false,
        "module": "es2015",
        "moduleResolution": "node",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es5",
        "typeRoots": ["node_modules/@types"],
        "lib": ["es2015", "es5", "es6", "dom"]
    }
}

Solution

  • I was getting exact same issue and tried multiple alternatives and options with tsconfig.json, polyfills.ts, package.json, but nothing worked for me.

    Finally one solution which made my application to work in IE browser was using one lower version of these dependencies -
    "@ng-idle/core": "^9.0.0-beta.1", "@ng-idle/keepalive": "^9.0.0-beta.1"