Ionic 2 Projects: updating to beta.6


#1

Hello Ionites! Migration guide extraordinaire @iignatov has created another excellent resource which he asked me to share with you, since there were some changes to imports in the starters as of beta.6.

  1. Update the Ionic CLI to the latest version:

npm install -g ionic@beta

  2. If you’re upgrading a project using Ionic 2.0.0-beta.3 or older check out the following guide first.

  3. Remove the line import 'es6-shim' from app.ts/app.js. If you’re using webpack, remove ‘es6-shim’ from the entries array in your webpack config if that is how you’re bundling it.

  4. Add es6-shim.min.js before angular2-polyfill.js in the index.html file:

  <!-- Polyfill needed for platforms without Promise and Collection support -->
  <script src="build/js/es6-shim.min.js"></script>
  <!-- Zone.js and Reflect-metadata  -->
  <script src="build/js/angular2-polyfills.js"></script>
  <!-- the bundle which is built from the app's source code -->
  <script src="build/js/app.bundle.js"></script>

  5. Update your package.json (do not copy&paste use these as a reference and update the ones in your file):

"dependencies": {
  "angular2": "2.0.0-beta.15",
  "es6-shim": "^0.35.0",
  "ionic-angular": "2.0.0-beta.6",
  "ionic-native": "^1.1.1",
  "ionicons": "3.0.0-alpha.3",
  "reflect-metadata": "0.1.2",
  "rxjs": "5.0.0-beta.2",
  "zone.js": "^0.6.11"
}

  6. In your package.json update the version of ionic-gulp-scripts-copy to ^1.0.1.

  7. From inside of your project’s folder run npm install to install the new packages.

  8. Check out the changelog for breaking changes and update your project accordingly.


[SOLVED] Blank screen & StatusBar.styleDefault, but Cordova is not available
Ionic Serve error - "This site can't be reached." (v2)
Updating to beta 6: Maximum call stack size exceeded
New Loading service Ionic 2
Ionic 2 error not showing in nav.push(somePage);
Toast throwing Error after disappearing
Beta 3 vs. Beta 4 + Sqlite
CSS Missing from build 404
Ionic2 with Real-time data not updating(firebase)
Update ion-select data
Ionic 2 APP won't run in earlier than Android 5.0?
Timing problems with SQLite storage
Ionic 2 Projects: updating to beta.4
Item-right does not work as it should after upgrading to beta 4
Since the Beta 4, my views don't update
Blank white screen when ionic serve on any starter
Ionic2 load ion-toggle or ion-select at will from promise?
FileReader not firing onloadend
#2

#3

I’ve just read about beta 5 been released yesterday and now a new one was released. Wow you people are doing work :slight_smile:


#4

Ionic Team, you’ve made my day!


#5

Great work guys!!! :slight_smile:


#6

Thanks!

I’m getting ‘cb() never called!’ after running ‘npm install’.


#7

hi @tim, is my version below up-to-date ? :slight_smile:

`

 Cordova CLI: 6.1.1
 Gulp version:  CLI version 3.9.1
 Gulp local:   Local version 3.9.1
 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
 ios-deploy version: 1.8.6 
 ios-sim version: 5.0.8 
 OS: Mac OS X El Capitan
 Node Version: v4.4.3
Xcode version: Xcode 7.3 Build version 7D175    `

#8

Updating node to the latest version fixed this issue for me.


#9

I have a project for Hybrid App. Can I use ionic2?


#10

I’m having the following error:

Error: Uncaught (in promise): [object Object]
at resolvePromise (angular2-polyfills.js:602)
at angular2-polyfills.js:579
at callCordovaPlugin (plugin.js:74)
at plugin.js:110
at plugin.js:93
at new ZoneAwarePromise (angular2-polyfills.js:648)
at getPromise (plugin.js:92)
at wrapPromise (plugin.js:109)
at Function. (plugin.js:164)
at Function.value [as registerPermission] (plugin.js:215)

ionic info

Your system information:

Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
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:
Node Version: v5.0.0


#11

Strange, I put the script es6-shim.min.js after angular2-polyfills and the error disappear.


#12

Perhaps I’m being special, but after npm install -g ionic@beta it seems only my Ionic CLI and lib updated.

Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.21
Ionic App Lib Version: 2.0.0-beta.11
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.11.0
Xcode version: Xcode 7.3 Build version 7D175


Cordova CLI: 6.0.0
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.11.0
Xcode version: Xcode 7.3 Build version 7D175

#13

Are you certain you updated the ionic-angular entry in your package.json?


#14

@rapropos Forgive me, I forgot that ionic info was a local command, and the version was related to the specific project, not what was pulled from ionic@beta.

Thanks buddy!


#15

thanks for the tip, what I did was reinstalled npm. Apparently I had 3.8.7 and the reinstallation downgraded it to 3.8.6.


#16

Hey @tim thanks for the guide. It was really helpful. Just a heads up:
My build was failing because I had a caret on my angular 2 version. ( "angular2": "^2.0.0-beta.15").

This was giving me the beta.16 and it took me a while to notice. I am not even sure how it got there in the first place. It would be helpful if there was a more explicit way to indicate when to use exact versions.


#17

@lricoy Most likely you copy-paste from somewhere or someone’s post.

@tim What about the Webpack version of the guide?


#18

Yeah we went back on forth on whether to include the caret for a while. Having the caret makes it easier to update if you’re using npm 2 (without the caret if you update angular and ionic has a peerDependency on the lower version it will cause the installation to fail unless you remove ionic first), but as people move to npm 3 it may make more sense to lock the version down. The hope was that eventually it wouldn’t matter because different angular versions wouldn’t break.

Updated for webpack, thanks! Let me know if I missed anything.


#19

Can we see somewhere what’s changed, fixed, updated, added since beta.5 ?


#20

Sure, check out the change log.