ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Unhandled Promise rejection: SyntaxError ; Zone: angular ; Task: Promise.then ; Value: SyntaxError

Open vinay-kumar opened this issue 10 years ago • 29 comments

** Ionic2, Windows IE 11, platform windows

Short description of the problem: Got this message when running start project with --ts

however, code running fine in Chrome

Unhandled Promise rejection: SyntaxError ; Zone: angular ; Task: Promise.then ; Value: SyntaxError Browser: IE11

Response blank screen

What behavior are you expecting?

Got this message

HTML1300: Navigation occurred. File: localhost:8100 DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337 EXCEPTION: Error: Uncaught (in promise): SyntaxError EXCEPTION: Error: Uncaught (in promise): SyntaxError STACKTRACE: Error: Uncaught (in promise): SyntaxError at resolvePromise (http://localhost:8100/build/js/angular2-polyfills.js:602:26) at Anonymous function (http://localhost:8100/build/js/angular2-polyfills.js:638:18) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/angular2-polyfills.js:421:18) at onInvokeTask (http://localhost:8100/build/js/app.bundle.js:27158:25) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/angular2-polyfills.js:421:18) at Zone.prototype.runTask (http://localhost:8100/build/js/angular2-polyfills.js:320:22) at drainMicroTaskQueue (http://localhost:8100/build/js/angular2-polyfills.js:541:26) at invoke (http://localhost:8100/build/js/angular2-polyfills.js:493:22)

Unhandled Promise rejection: SyntaxError ; Zone: angular ; Task: Promise.then ; Value: SyntaxError "Unhandled Promise rejection:" { [functions]: , proto: { }, ABORT_ERR: 20, code: 12, constructor: { }, DATA_CLONE_ERR: 25, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, INDEX_SIZE_ERR: 1, INUSE_ATTRIBUTE_ERR: 10, INVALID_ACCESS_ERR: 15, INVALID_CHARACTER_ERR: 5, INVALID_MODIFICATION_ERR: 13, INVALID_NODE_TYPE_ERR: 24, INVALID_STATE_ERR: 11, message: "SyntaxError", name: "SyntaxError", NAMESPACE_ERR: 14, NETWORK_ERR: 19, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, PARSE_ERR: 81, QUOTA_EXCEEDED_ERR: 22, SECURITY_ERR: 18, SERIALIZE_ERR: 82, SYNTAX_ERR: 12, TIMEOUT_ERR: 23, TYPE_MISMATCH_ERR: 17, URL_MISMATCH_ERR: 21, VALIDATION_ERR: 16, WRONG_DOCUMENT_ERR: 4 } "; Zone:" "angular" "; Task:" "Promise.then" "; Value:" { [functions]: , proto: { }, ABORT_ERR: 20, code: 12, constructor: { }, DATA_CLONE_ERR: 25, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, INDEX_SIZE_ERR: 1, INUSE_ATTRIBUTE_ERR: 10, INVALID_ACCESS_ERR: 15, INVALID_CHARACTER_ERR: 5, INVALID_MODIFICATION_ERR: 13, INVALID_NODE_TYPE_ERR: 24, INVALID_STATE_ERR: 11, message: "SyntaxError", name: "SyntaxError", NAMESPACE_ERR: 14, NETWORK_ERR: 19, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, PARSE_ERR: 81, QUOTA_EXCEEDED_ERR: 22, SECURITY_ERR: 18, SERIALIZE_ERR: 82, SYNTAX_ERR: 12, TIMEOUT_ERR: 23, TYPE_MISMATCH_ERR: 17, URL_MISMATCH_ERR: 21, VALIDATION_ERR: 16, WRONG_DOCUMENT_ERR: 4 }

Error: Uncaught (in promise): SyntaxError { [functions]: , proto: { }, description: "Uncaught (in promise): SyntaxError", message: "Uncaught (in promise): SyntaxError", name: "Error", promise: { }, rejection: { }, stack: "Error: Uncaught (in promise): SyntaxError at resolvePromise (http://localhost:8100/build/js/angular2-polyfills.js:602:26) at Anonymous function (http://localhost:8100/build/js/angular2-polyfills.js:638:18) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/angular2-polyfills.js:421:18) at onInvokeTask (http://localhost:8100/build/js/app.bundle.js:27158:25) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/angular2-polyfills.js:421:18) at Zone.prototype.runTask (http://localhost:8100/build/js/angular2-polyfills.js:320:22) at drainMicroTaskQueue (http://localhost:8100/build/js/angular2-polyfills.js:541:26) at invoke (http://localhost:8100/build/js/angular2-polyfills.js:493:22)", task: { }, zone: { } }

Steps to reproduce:

  1. in windows cmd run > ionic start testApp --v2 --ts
  2. cd testApp
  3. ionic serve

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

2.0.0.beta6

Run ionic info from terminal/cmd prompt:** (paste output below)

Cordova CLI: Not installed Ionic Framework Version: 2.0.0-beta.6 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Windows 8.1 Node Version: v4.4.3


Dependency warning - for the CLI to run correctly, it is highly recommended to install/upgrade the following:

Please install your Cordova CLI to version >=4.2.0 npm install -g cordova


vinay-kumar avatar Apr 30 '16 07:04 vinay-kumar

Hello @vinay-kumar! It looks as if you do not have the Cordova cli installed, would you mind running npm install -g cordova and trying again please? Thanks!

jgw96 avatar May 02 '16 14:05 jgw96

I have already installed it.

I am just running it with ionic serve

vinay-kumar avatar May 04 '16 05:05 vinay-kumar

Hey @vinay-kumar . So we were able to reproduce this issue, but unfortunately at this time we do not support IE 11. Are you on windows 10? If so, we do support edge fully, along with chrome. Also if you have a windows 10 device, we support windows universal apps as these use an edge based webview, but we do not support windows phone 8 devices as these use IE based webviews. Thanks for using Ionic!

jgw96 avatar May 05 '16 16:05 jgw96

I am sorry to say but the same issues is faced on IE Edge.

When I try to run it ionic serve on IE Edge blank screen is shown to me. I don't think it's platform (device ) specific rather than Edge related error

vinay-kumar avatar May 11 '16 08:05 vinay-kumar

Getting the same error here: https://github.com/driftyco/ionic-conference-app/issues/165

brandyscarney avatar May 16 '16 14:05 brandyscarney

@jgw96 is support for IE >= 10 on the roadmap? It is supported by Angular 2, I would assume this would be supported by Ionic as well (or is that a false assumption?)

tleguijt avatar May 20 '16 07:05 tleguijt

Hello @tleguijt ! At this time we are not planning on any IE support, although we fully support edge. While Angular 2 does have support for IE, with all the UI components we have built, and all the animations, IE just does not have the html5 support, modern javascript support or the performance needed for Ionic 2 to perform like it should. Also, windows 10 apps use an edge webview under the hood, so, as you have probably heard, we have full support for windows 10 UWP apps! Hope this explains things!

jgw96 avatar May 20 '16 16:05 jgw96

Hello @vinay-kumar are you using promises anywhere in your application? Especially Promise.reject()?

jgw96 avatar May 25 '16 14:05 jgw96

Not really I have an application fully built upon ionic 2 on Android and iOS. So I tried to build windows version and facing this issue.

Second there is no step by step process to build specially for Windows phone 10. This really becomes an issue for guy like me who has no experience in building windows app. May be an step by step example app can make life easier. Thanks

vinay-kumar avatar May 26 '16 17:05 vinay-kumar

Hi I have this happening here as well on ie11 and windows store app. I am afraid , it works in edge though, I would have thought windows universal app use edge api.?? Error: Uncaught (in promise): SyntaxError at resolvePromise (http://localhost:8100/build/js/zone.js:538:26) at Anonymous function (http://localhost:8100/build/js/zone.js:574:18) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/zone.js:354:18) at onInvokeTask (http://localhost:8100/build/js/app.bundle.js:30927:25) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/zone.js:354:18) at Zone.prototype.runTask (http://localhost:8100/build/js/zone.js:256:22) at drainMicroTaskQueue (http://localhost:8100/build/js/zone.js:474:26) at invoke (http://localhost:8100/build/js/zone.js:426:22)\

I'm using this shim: * es6-shim: v0.35.1

oz-frog avatar Jun 01 '16 01:06 oz-frog

HI, in case that helps, specify explicitly which version of the windows platform to target when building /running with cordova, in config.xml add:

<preference name="windows-target-version" value="10.0" /> <preference name="windows-phone-target-version" value="10.0" />

ionic build windows now builds for edge webview.

a newer version of the es6_shim that supports ie11 / win8 when working with angular 2 would still be welcome.

oz-frog avatar Jun 01 '16 01:06 oz-frog

Hi Folks, just an extra voice here, the market share for Windows 7 is currently 47% of desktops: https://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0

I have rather foolishly spent the last month or so developing a couple of apps in Ionic 2 without checking this first, obviously as a dev I use the latest thing but my clients don't. They really really don't. I just made the assumption that Angular 2 (and by extension Ionic 2) would work on at least IE 11. Sucks to be me huh?

None of us want to target IE, but it's the difference between being desktop browser capable app platform and just another mobile app framework. This compatibility is a stretch we need to make, even if we don't like it. It doesn't need to be awesome, it doesn't need fancy effects, it just has to run without crashing.

webprofusion-chrisc avatar Jun 01 '16 02:06 webprofusion-chrisc

The fix/workaround for me was to to include the IE shim (before any other scripts in index.html) which is no longer distributed with Angular 2 RC1 due to licensing issues:

https://npmcdn.com/[email protected]/es6/dev/src/testing/shims_for_IE.js

+1 from me for B or C grade support for IE 11 being included :)

For me the particular polyfill that was required (before any other scripts in index.html) was:

/! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie/ if (!Object.hasOwnProperty('name')) { Object.defineProperty(Function.prototype, 'name', { get: function() { var matches = this.toString().match(/^\s_function\s_(\S_)\s_(/); var name = matches && matches.length > 1 ? matches[1] : ""; // For better performance only parse once, and then cache the // result through a new accessor for repeated access. Object.defineProperty(this, 'name', {value: name}); return name; } }); }

webprofusion-chrisc avatar Jun 01 '16 03:06 webprofusion-chrisc

Hi,

as an alternative for win 7/ie7, ionic 2 app run fine in win7/chrome. so it is still usable in a desktop environment.

i would still be nice to have ie11 /windows 8 app support. I have not been able to get ionic 2 app to run on that yet because of the issue es6-shim: v0.35.1 has with promise (lack of) implementation:

Unhandled Promise rejection: SyntaxError ; Zone: angular ; Task: Promise.then ; Value: SyntaxError

oz-frog avatar Jun 01 '16 04:06 oz-frog

Hello all! Is this still an issue with the latest version of ionic? Thanks!

jgw96 avatar Jun 20 '16 16:06 jgw96

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

jgw96 avatar Jun 24 '16 14:06 jgw96

To be clear, this issue is caused by having no official support for IE 11. The problem is not resolved but the closing of the issue is fair if Ionic will not support IE.

webprofusion-chrisc avatar Jun 25 '16 01:06 webprofusion-chrisc

Hello @webprofusion-chrisc ! Sorry, but at this time we have no plans to support IE11, however we do support Edge and using Ionic to build Windows Universal Apps!

jgw96 avatar Jun 27 '16 13:06 jgw96

Hello All,

When running my app, I'm getting below exception:-

ionic $ 0 414644 log Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode. 1 414647 warn Native: tried calling undefined.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator 2 414848 group EXCEPTION: Error: Uncaught (in promise): SyntaxError 3 414851 error EXCEPTION: Error: Uncaught (in promise): SyntaxError 4 414853 error STACKTRACE: 5 414855 error Error: Uncaught (in promise): SyntaxError at resolvePromise (http://localhost:8100/build/js/zone.js:538:26) at Anonymous function (http://localhost:8100/build/js/zone.js:574:18) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/zone.js:354:18) at onInvokeTask (http://localhost:8100/build/js/app.bundle.js:35210:25) at ZoneDelegate.prototype.invokeTask (http://localhost:8100/build/js/zone.js:354:18) at Zone.prototype.runTask (http://localhost:8100/build/js/zone.js:256:22) at drainMicroTaskQueue (http://localhost:8100/build/js/zone.js:474:26) at invoke (http://localhost:8100/build/js/zone.js:426:22) 6 414858 groupEnd 7 414860 error Unhandled Promise rejection:, [object Object], ; Zone:, angular, ; Task:, Promise.then, ; Value:, [object Object]

ionic info

Your system information:

Cordova CLI: 6.2.0 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.32 Ionic App Lib Version: 2.0.0-beta.18 OS: Node Version: v4.4.5

If you need more info on that, Please let me know.

srishiva89 avatar Jul 13 '16 04:07 srishiva89

@webprofusion-chrisc :+1: @jgw96 referencing the shims for ie script as mentioned by @webprofusion-chrisc fixed the page rendering IE 11.

Browser: IE11 Version: 11.0.9600.18376CO

kkganesan avatar Aug 02 '16 15:08 kkganesan