Ionic2 throws "Error: Uncaught (in promise): SyntaxError at resolvePromise" on Windows Phone Emulator
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.
Hello, thanks for opening an issue with us! Which version of windows is this device emulator running? Thanks for using Ionic!
Windows 10 x64, Visual Studio Community 2015
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 .
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.
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.
This has it all covered.
https://cordova.apache.org/docs/en/latest/guide/platforms/win8/
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!
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
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.