Uncaught ReferenceError: ionic is not defined after beta10 update


#1

After updating my package.json similar to what the conference app has then deleting node_modules folder and running npm install, I’m getting error below:

ionic $ 0 060928 error Uncaught ReferenceError: ionic is not defined, http://localhost:8101/?ionicplatform=android, Line: 93
0 060932 error Uncaught ReferenceError: ionic is not defined, http://localhost:8101/?ionicplatform=ios, Line: 93
10.2 MB bytes written (7.10 seconds)


#2

Could you share your ionic info output?
Sounds like you have an older version of the CLI


#3

Here’s my ionic info:

Your system information:

Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.10
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.4
Xcode version: Xcode 7.3.1 Build version 7D1014


#4

Thanks for pointing me to the right direction. I wasn’t paying attention to ionic cli whenever I update my project. Also when looking at ionic-cli releases the latest is still 2.0.0-beta.25, I might’ve missed the info where to properly check for the updates. Though I had an issue after updating it, it was not generating the app.bundle.js file. It turns out its because of the Cannot find module 'lodash' error that I keep getting (and ignoring) so I followed your blog but the error was still there so for now I temporarily commented it out.

Your system information:

Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.4
Xcode version: Xcode 7.3.1 Build version 7D1014

Update:
Adding /// <reference path="modules/lodash/index.d.ts" /> on main.d.ts does it for me. I don’t know why explicitly including main.d.ts doesn’t work.


#5

How do i update mine to beta 10? is it out?


#6

I think so, check it out here.

The way I updated mine,

  1. I copied the versions of dependencies from package.json of their conference app.

  2. Deleted the entire node_modules folder

  3. Ran npm install.

I had a couple of issues because my ionic cli was outdated.