2

My Angular 6/Visual studio, .net framework 4.6.2 application shows fine in Chrome but Not showing in IE 11. I did google the issue and as per [IE 11 compatibility errors using Angular 5 uncommented and did npm installs as recommended.

also as per: [Angular 2 / 4 / 5 not working in IE11 added

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
 <script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>

in the index.html under src and index.cshtml under Home.

When I do 'Inspect element' in IE, I get in console:

SCRIPT1010: Expected identifier
File: vendor.js, Line: 174472, Column: 9

vendor.js from lines 174466 - 174474 gives:

// Unless required  by  applicable  law  or  agreed  to  in  writing,  software 
// distributed under the License is distributed on an "AS  IS"  BASIS,  WITHOUT
// WARRANTIES OR CONDITIONS  OF  ANY  KIND, either express or implied.  See the 
// License for the specific  language  governing  permissions  and  limitations 
// under the License.
     Object.defineProperty(exports, "__esModule", { value: true });
174472 - >function* Forward(target) {
    yield* target;
  }

Please guide what to do?

P.S. This is my tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}
SilverFish
  • 1,014
  • 6
  • 28
  • 65
  • 1
    You need to uncomment some stuff on the polyfill.ts for IE11 support. – penleychan Feb 14 '19 at 15:07
  • Try with this answer https://stackoverflow.com/questions/52161737/angular-application-gives-blank-page-in-ie11/52161877#52161877 – Nenad Radak Feb 14 '19 at 15:12
  • penleychan, Already uncommented all imports and did recommended npm installs – SilverFish Feb 14 '19 at 15:20
  • Any suggestions how vendor.js is created? I am looking at a previous Angular 6 project and it does not even have the code which is throwing error. Any thoughts? – SilverFish Feb 14 '19 at 16:04
  • What version of ES are you targeting for your build? IE doesn't suuport anything ES6+, so you'll need to target ES5 for your build. – joh04667 Feb 14 '19 at 16:19
  • modified code and added tsconfig.json. It has "target": "es5". could es2017 be the culprit? – SilverFish Feb 14 '19 at 16:28
  • I changed es2017 to es2015 under "lib" but same issue persists. Please guide – SilverFish Feb 14 '19 at 16:40
  • can you post the Enough code to reproduce the problem as in [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – Zhi Lv Feb 15 '19 at 08:34

0 Answers0