Error while executing ionic 2 application - ionic2

For my sample ionic 2 application, I am getting below error when below command is executed from windows 10 command prompt.
ionic serve
Any idea what could be the reason for this error ?

I have uninstalled and installed cordova and ionic again . This has fixed the issue.

Related

usage of --livereload command in Ionic2/ Ionic3

Ionic CLI 3.8 has come up with a --livereload option to live reload the changes from your app. Can someone tell the proper command for using it?
I tried with only --livereload and also ionic cordova --livreload but neither seems to work!
Just like #Duannx mentioned in the comments, the proper CLI command is
ionic cordova run android --livereload / ionic cordova run ios --livereload
or
ionic cordova run android --l / ionic cordova run ios --l
(Or just ionic run android/ios --l if you're using an older version of the CLI).
Please notice that in order to make the livereload feature to work, both the device and the computer running the command must be in the same WIFI network.
Otherwise you'll see errors like:
The connection to the server was unsuccessful
(http://XX.XX.XX.XX:XXXX)

Ionic 2 app takes too much time to load even build with --prod flag

Well, I am new to ionic 2 and build my first app having 2 pages and 2 services which are the very simple and for a news website.
The problem is, first I build my app for android using --release flag the file size was near 4MB and when I deploy on my mobile the load time was 14 - 17 seconds.
Then I search for 2 days to fix this issue and came up with the idea that I should enable production mode in main.ts and build using --prod flag . Now file size is 2.65MB and load time is 8 - 11 seconds which I think too much time for a mobile device. :(
My system information is:
ordova CLI: 6.5.0
Ionic Framework Version: 3.2.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.10.0
Xcode version: Not installed
In my app I simply pulling news from rest server and displaying on my page. Am I doing something wrong or is there any issue with new version of ionic? I also read by some people that ionic 1 speed was good than the latest version.
Note: I run my app on 3 different devices the issue remain the same.
Check your config.xml, and set SplashScreenDelay value to zero
<preference name="SplashScreenDelay" value="0"/>.
For me, below command worked:
ionic cordova build ios --prod --aot --minifyjs --minifycss --optimizejs
You can use your own platform in above command instead of ios.
It decreased app load time in my case.
Please find more details here https://forum.ionicframework.com/t/ionic-app-takes-too-long-to-start/97546

Ionic-Native issue in ionic 2

I have added a Cordova file transfer plugin from Ionic native and imported transfer from ionic native to my application page
I am not getting any syntax error as well as command prompt errors
But when I run my application using Ionic serve it is showing me
{Cannot find module "ionic-native"}
Can anyone please help me on this
Did u check it properly, weather u have installed ionic-native ?
Plus which version of ionic are you using, in ionic 3 (launched recently) they removed ionic-native and kept it seperately in #ionic-native. And u'll have to indivisually install every plugin u r using.
http://blog.ionic.io/ionic-native-3-x/

Ionic 2 , unable to create APK file

I have developed a sample ionic 2 application , and it is working fine locally in my windows system( browser ).
When I executed below command to create an .apk file , it is showing error depicted in the image.
ionic package build android
Any idea what needs to be done to fix this issue.

ionic2 app not able to run on internet explorer

I created a sample ionic 2 App which works perfectly on Chrome and Android Browser, but when I tried it on Internet Explorer It giving me below error.
>EXCEPTION: Error: Uncaught (in promise): SyntaxError
>EXCEPTION: Error: Uncaught (in promise): SyntaxError
>STACKTRACE:
>Error: Uncaught (in promise): SyntaxError
>at resolvePromise (http://localhost/build/js/angular2-polyfills.js:602:26)
>at Anonymous function (http://localhost/build/js/angular2-polyfills.js:638:18)
>at ZoneDelegate.prototype.invokeTask
While Angular 2 sample project is working fine on Internet Explore why there is a difference in IONIC 2 build , UI issue is fine but at least it should run the App without breaking.
I just found this official post on the Ionic forum saying that Ionic 2 doesn't support Internet Explorer, only Edge: https://forum.ionicframework.com/t/ionic-2-sample-app-not-working-on-internet-explore/50283/2
No idea though if this will change for future releases, but I wouldn't count on it... Time to say goodbye to IE, finally ;)
I was able to render IONIC 2 on Internet Explolrer 10.
In order to install the proper polyfills do this:
npm install core-js --save
Then in your app class import it
import 'core-js';
It worked for me with core-js version 2.4.1 on Ionic 2 beta 10, Angular 2.0.0-rc.3 .
On my computer it looks like IE opens the ionic application in Compatibility Mode by default.
After you disable Compatibility Mode the pages will work fine.