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

As a further update to this (because the situation changes as Ionic is updated), referencing core-js (/client/shim.min.js) plus the usual es6-shim works generally.

If you are using a component which uses childNode.remove() (such as Searchbar) you need to add the childNode.js polyfill for those browsers that don't support it: https://github.com/seznam/JAK/blob/master/lib/polyfills/childNode.js

webprofusion-chrisc avatar Aug 22 '16 02:08 webprofusion-chrisc

Hi All,

Having the same issue:

polyfills.js:3 Unhandled Promise rejection: Cannot read property 'Ionic' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'Ionic' of undefined at setupConfig (config.js:363) at _callFactory (core.js:10648) at _createProviderInstance$1 (core.js:10598) at initNgModule (core.js:10548) at new NgModuleRef_ (core.js:11791) at createNgModuleRef (core.js:11781) at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:14091) at NgModuleFactory_.create (core.js:15215) at core.js:5367 at t.invoke (polyfills.js:3) TypeError: Cannot read property 'Ionic' of undefined at setupConfig (http://localhost:8100/build/vendor.js:17266:23) at _callFactory (http://localhost:8100/build/vendor.js:11001:20) at _createProviderInstance$1 (http://localhost:8100/build/vendor.js:10951:26) at initNgModule (http://localhost:8100/build/vendor.js:10901:28) at new NgModuleRef_ (http://localhost:8100/build/vendor.js:12144:9) at createNgModuleRef (http://localhost:8100/build/vendor.js:12134:12) at Object.debugCreateNgModuleRef [as createNgModuleRef] (http://localhost:8100/build/vendor.js:14444:12) at NgModuleFactory_.create (http://localhost:8100/build/vendor.js:15568:25) at http://localhost:8100/build/vendor.js:5720:78 at t.invoke (http://localhost:8100/build/polyfills.js:3:14976) n.onUnhandledError @ polyfills.js:3

Was there any solution?

kierandesmond avatar Jan 17 '18 21:01 kierandesmond

Hey all, any solution here? Its really frustrating!

kierandesmond avatar Jan 19 '18 15:01 kierandesmond

@kierandesmond this issue is long since closed, can you confirm which version of Ionic you are on? Are you trying to get IE11 to work? Did you upgrade an old app or did you start a new app using the current version of Ionic? It's unlikely that the solutions described here are still completely relevant but there may be a need for some polyfill.

webprofusion-chrisc avatar Jan 20 '18 03:01 webprofusion-chrisc

Hi

Only workaround is to use latest IE and latest ionic version

On 20-Jan-2018 8:33 AM, "Christopher Cook" [email protected] wrote:

@kierandesmond https://github.com/kierandesmond this issue is long since closed, can you confirm which version of Ionic you are on? Are you trying to get IE11 to work? Did you upgrade an old app or did you start a new app using the current version of Ionic? It's unlikely that the solutions described here are still completely relevant but there may be a need for some polyfill.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic/issues/6386#issuecomment-359140096, or mute the thread https://github.com/notifications/unsubscribe-auth/AA95pS8Dn1F0BvPnPNKpsVKD185_tAduks5tMVdugaJpZM4ITWV8 .

vinay-kumar avatar Jan 20 '18 06:01 vinay-kumar

Hi all,

This is my environment. Perhaps theres a mismatch?

`

@ionic/cli-plugin-proxy : 1.5.7
@ionic/cli-utils        : 1.19.1
ionic (Ionic CLI)       : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v8.9.4
npm  : 5.6.0
OS   : Windows 10

Environment Variables:

ANDROID_HOME     : not set
HTTP_PROXY       : not set
http_proxy       : not set
HTTPS_PROXY      : not set
https_proxy      : not set
IONIC_HTTP_PROXY : not set
PROXY            : not set
proxy            : not set`

kierandesmond avatar Jan 22 '18 16:01 kierandesmond

Please check browser compatibility https://ionicframework.com/docs/intro/browser-support/

On Mon, Jan 22, 2018 at 10:22 PM, kierandesmond [email protected] wrote:

Hi all,

This is my environment. Perhaps theres a mismatch?

`cli packages: (C:\Users\kierandes\Documents\DSF\Apps\CSA\main\node_ modules)

@ionic/cli-plugin-proxy : 1.5.7 @ionic/cli-utils : 1.19.1 ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8 Cordova Platforms : none Ionic Framework : ionic-angular 3.9.2

System:

Node : v8.9.4 npm : 5.6.0 OS : Windows 10

Environment Variables:

ANDROID_HOME : not set HTTP_PROXY : not set http_proxy : not set HTTPS_PROXY : not set https_proxy : not set IONIC_HTTP_PROXY : not set PROXY : not set proxy : not set`

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic/issues/6386#issuecomment-359489338, or mute the thread https://github.com/notifications/unsubscribe-auth/AA95pTy9C093fLR_q75KEgcMBcNe8nMfks5tNLy3gaJpZM4ITWV8 .

vinay-kumar avatar Jan 23 '18 08:01 vinay-kumar

It wasn't browser compatiability. I am using Chrome. In the end it was that I had added "Platform" to modules as a provider in error. Works great now that I've removed it. 

----- Original Message ----- From: "ionic-team/ionic" To:"ionic-team/ionic" Cc:"kierandesmond" , "Mention" Sent:Tue, 23 Jan 2018 00:57:04 -0800 Subject:Re: [ionic-team/ionic] Unhandled Promise rejection: SyntaxError ; Zone: angular ; Task: Promise.then ; Value: SyntaxError (#6386)

Please check browser compatibility

https://ionicframework.com/docs/intro/browser-support/

On Mon, Jan 22, 2018 at 10:22 PM, kierandesmond wrote:

Hi all,

This is my environment. Perhaps theres a mismatch?

`cli packages: (C:UserskierandesDocumentsDSFAppsCSAmainnode_ modules)

@ionic/cli-plugin-proxy : 1.5.7 @ionic/cli-utils : 1.19.1 ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8 Cordova Platforms : none Ionic Framework : ionic-angular 3.9.2

System:

Node : v8.9.4 npm : 5.6.0 OS : Windows 10

Environment Variables:

ANDROID_HOME : not set HTTP_PROXY : not set http_proxy : not set HTTPS_PROXY : not set https_proxy : not set IONIC_HTTP_PROXY : not set PROXY : not set proxy : not set`

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread

.

—

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [1], or mute the thread [2].

Links:

[1] https://github.com/ionic-team/ionic/issues/6386#issuecomment-359722806 [2] https://github.com/notifications/unsubscribe-auth/AgjU0n3FCB1AwBJkQCz_MrScgR1E3nrVks5tNZ7ggaJpZM4ITWV8

kierandesmond avatar Jan 23 '18 09:01 kierandesmond

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 01 '18 10:09 ionitron-bot[bot]