Ionic is not defined


#1

How do to solve ionic error

Uncaught ReferenceError: ionic is not defined


#2

thats normal, just ignor it
when using ionic serve.
The ionic component will only load when using on an actual device.

Maybe you could find a way to supress the error message though.


#3

I had that same error when using ionic serve -t android. I managed to lose the error by changing the letter p in the url of ionic serve (I believe something as ionicplatform) to a capital P. So it should be ionicPlatform. Not sure if itll help in your case though.


#4

So in order to help, we need some more information. What’s your ionic-cli version (ionic -v), what cause this error to happen? We need more info to help! :smile:


#5

thanks @mhartington i fixed it already. :slight_smile:


#6

@JosephMendez how did you fix it? Ionic is not defined for me using ionic cli v.1.7.15

I am trying to use Ionic.Auth (and checking ionic.Auth) ionic.Auth is undefined, Ionic is not defined.


#7

You need install ionic-cli beta

Execute this:
npm install -g ionic@beta

and try run your app again.


#8

@mhartington This error happens in V2 when ionic serve - t android (or http://localhost:8100/?ionicplatform=android in browser).

The culprit can be seen in the following screenshot of Chrome Developer:


#9

Ahh alright. That’s just a difference between V1 lab and what we need to support Lab in V2.
It’s safe to ignore that for now. But it will be fixed and updated in the CLI


#10

Didn’t seem to work for me :confused: I am testing in Chrome on my desktop.