Angular-cli: vendor.bundle.js syntax error on IE10 Windows 7

Created on 12 Dec 2017  路  7Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 1.5.4
Node: 8.6.0
OS: win32 x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.4.2
webpack: 3.8.1

Internet Explorer version 10.0.9200.17609

Repro steps

  • Step 1: install angular cli 1.5.4
  • Step 2: create new app with ng new sample
  • Step 3: install and uncomment everything in the polyfill.ts file except web-animation.js
  • Step 4: ng serve
  • Step 5: open app on IE 10 with console

Observed behavior

The IE console displays this message:

SCRIPT1002: Syntax Error
vendor.bundle.js, Line 446 Character 1

The source line starts with:

eval("/* WEBPACK VAR INJECTION */(function(__resourceQuery) {\n\n/* global __resourceQuery ...

dev mode console screenshot

Desired behavior

What should I do to make it work?

Mention any other details that might be useful (optional)

I try to serve the application in production mode with ng serve --prod. The IE console displays a similar message:

SCRIPT1002: Syntax Error
main.6452b0e0d49fae94852f.bundle.js, Line 1 Character 9106

The source fragment starts with:

const r=n("VtmP"), ...

the keyword const are not supported by IE 10!

prod mode console screenshot

2 (required) broken

Most helpful comment

@clydin says in issue #8596 the live reload feature of the webpack-dev-server require ES2015 but IE10 doesn't support it.

Using --no-live-reload solves the error.

But i don't understand why an error occurs in prod mode?

All 7 comments

+1,but build work well

@clydin says in issue #8596 the live reload feature of the webpack-dev-server require ES2015 but IE10 doesn't support it.

Using --no-live-reload solves the error.

But i don't understand why an error occurs in prod mode?

ng serve uses live reload by default in all cases as it's the defining characteristic of the command (i.e., a development server without live reload is of fairly minimal utility).
The reason the error originates from the main bundle instead of vendor in production is because the vendor bundle is combined and optimized with the main bundle. This allows for more comprehensive size reductions in the final output.

Closing as things appear to be working as intended. Please re-open if you feel this is in error.

The prod build error was due to the URL class usage. So actually there is no more error :)

Error persists:

eval("/* unused harmony export VERSION /\n/ unused harmony export JitC...

for localhost and Production, with IE 10 and 11

Angular CLI: 1.6.3
Node: 9.2.0
OS: win32 x64 (localhost)
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.3
typescript: 2.5.3
webpack-dev-server: 2.9.2

After applying solutions listed here, we have additional error "SecurityError"

image

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbeckton picture jbeckton  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

donaldallen picture donaldallen  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments