angular: IE11 Polyfills Issue - SCRIPT1002: Syntax error main.bundle.js

I’m submitting a…

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see

Current behavior

I cannot open the project in IE11. The following error is thrown - SCRIPT1002: Syntax error main.bundle.js

I have done the following steps after investigating the issue a couple of hours:

  1. Enabled polyfills
  2. Added shims to index.html -
  3. Set __Zone_enable_cross_context_check property to true in index.html file.
  4. Set es5 in tsconfig files.

Expected behavior

Minimal reproduction of the problem with instructions

A fully runnable sample is available here - Just clone the repo and run: npm install npm start

What is the motivation / use case for changing the behavior?


Angular version: X.Y.Z

- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [x] IE version 11
- [ ] Edge version XX
For Tooling issues:
- Node version: XX  
- Platform:  


About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (10 by maintainers)

Most upvoted comments

I am also facing the running issue with IE11. I already uncommented required import statement from polyfills. It is not working for me. I am getting an error in the vendor.js “const ucs2encode = array => String.fromCodePoint(array);” Does anyone faced the same issue.

@danail-vasilev , about the registry, by default, it not exists, so you need to create the keys yourself, I also tried those settings in Windows 10.

And about the point3 .

So, as per the issue discussion, I have concluded the following: The problem occurs only when you open the console in IE11 and it doesn’t break the functionality. If you just don’t want to see the exception during development you can set the __Zone_enable_cross_context_check property to true but in production it shouldn’t be set in order to avoid performance issue. If that is the case you can mention that in the comment of the fix that has just been merged. Thank you !

in fact, there are several issues related with IE.

  1. if you compile the project with target -> es6, IE will not work and throw error like Syntax error.
  2. if you open developer tools and without set the __Zone_enable_cross_context_check flag, the error like Can't execute code from a freed script may occur. in this case, you should set the flag to true in polyfill, it will have some performance impact so you should only do this in dev mode.
  3. About the error SecurityError, I believe this is the websocket error with dev server. so you should try the registry way.

I would like to make a PR to add those information as trouble shooting in aio document (I am not sure it is the right place) later.

I am facing the same issue. The culprit seems to be punycode@2.1.1 included by @angular-devkit. This is my dependency tree:

| Reactive components for Angular with customizable UX themes
+-- @angular-devkit/build-angular@0.6.8
|   | Angular Webpack Build Facade
|   | git+
|   |
|   +-- ajv@6.4.0
|   |   | Another JSON Schema Validator
|   |   | git+
|   |   |
|   |   `-- uri-js@3.0.2
|   |     | An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.
|   |     | git+ssh://
|   |     |
|   |     `-- punycode@2.1.1
|   |       A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.
|   |       git+
|   |