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

Ionic2 throws "Error: Uncaught (in promise): SyntaxError at resolvePromise" on Windows Phone Emulator

Open vong-srey opened this issue 10 years ago • 9 comments

I'm not sure if this issue has been raised but I couldn't find any in Google.

When I run my Ionic 2 tutorial (http://ionicframework.com/docs/v2/getting-started/tutorial/)

  • on Windows Phone (Universal) device: Emulator 8.1 720P 4.7 inch
  • in Visual Studio Community (configured Ionic 2 as described here: https://blogs.msdn.microsoft.com/rido/2016/05/11/ionic2-and-visual-studio/),

it throws this error:

EXCEPTION: Error: Uncaught (in promise): SyntaxError
   EXCEPTION: Error: Uncaught (in promise): SyntaxError
   STACKTRACE:
   Error: Uncaught (in promise): SyntaxError
   at resolvePromise (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:538:26)
   at Anonymous function (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:574:18)
   at invokeTask (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:354:18)
   at onInvokeTask (ms-appx://com.ionicframework.myionic2project209080/www/build/js/app.bundle.js:35206:25)
   at invokeTask (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:354:18)
   at runTask (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:256:22)
   at drainMicroTaskQueue (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:474:26)
   at invoke (ms-appx://com.ionicframework.myionic2project209080/www/build/js/zone.js:426:22)

But, it works perfectly fine when I debug on Android device or iOS device.

vong-srey avatar Jul 08 '16 18:07 vong-srey

Hello, thanks for opening an issue with us! Which version of windows is this device emulator running? Thanks for using Ionic!

jgw96 avatar Jul 08 '16 18:07 jgw96

Windows 10 x64, Visual Studio Community 2015

vong-srey avatar Jul 08 '16 20:07 vong-srey

Hello, Here is my 2 cents on the issue:

  • For this to work angular 2 requires the e6-shim to be correctly included and linked in index.html: <script src="build/js/es6-shim.min.js"></script>
  • Make also sure you are correctly building for windows mobile 8.1 (looks that way) as the shim wont work with version below 8.1, see project page.

https://github.com/paulmillr/es6-shim

Can't wait approved ES6 specification are consistently implemented and the shim is no longer required and I can switch my transpiler to ES6 output .

oz-frog avatar Jul 08 '16 21:07 oz-frog

I already have <script src="build/js/es6-shim.min.js"></script> in my index.html and the issues occurred in both Windows Mobile 8.1 and Windows Mobile 10 Emulator.

vong-srey avatar Jul 09 '16 00:07 vong-srey

It certainly should work for win 10. I compiled ionic 2 beta 10 and it runs fine for me. Since you are on window 10 maybe install the appx directly on it rather than using emulator. That might tell you something.

Also you need to configure Cordova config.xml to output for Windows 10. That helped me getting it to work on at least Windows 10 mobile and desktop apps. If none works try again with vanilla project.. It will work once setup right cause it does for me since early beta of ionic 2

Good luck and post back results.

oz-frog avatar Jul 10 '16 04:07 oz-frog

This has it all covered.

https://cordova.apache.org/docs/en/latest/guide/platforms/win8/

oz-frog avatar Jul 10 '16 06:07 oz-frog

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 Jul 19 '16 19:07 jgw96

Hello, i am having the same error as above when building for windows. Using Windows 10 x64, Visual Studio Community 2015.

@jgw96 Any solution for the above

sherozejoomun avatar Apr 26 '17 08:04 sherozejoomun

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 03 '18 06:09 ionitron-bot[bot]