TypeError: Cannot read property 'isAvailable'

I have made a test app to use auth0 on Ionic. Whenever I run ‘auth.login()’, I get the following error:

TypeError: Cannot read property ‘isAvailable’ of undefined
at Function.Browser.isAvailable (vendor.js:sourcemap:149943)
at getAgent (vendor.js:sourcemap:149922)
at CordovaAuth.authorize (vendor.js:sourcemap:87291)
at AuthProvider.webpackJsonp.131.AuthProvider.login (main.js:sourcemap:68)
at Object.eval [as handleEvent] (HomePage.html:17)
at handleEvent (vendor.js:sourcemap:13963)
at callWithDebugContext (vendor.js:sourcemap:15472)
at Object.debugHandleEvent [as handleEvent] (vendor.js:sourcemap:15059)
at dispatchEvent (vendor.js:sourcemap:10378)
at vendor.js:sourcemap:11003

I’ve checked plugins and dependencies and followed the ionic auth0 documentation, yet I cant get it to work.
I hope someone can help me with it.


According to this answer in StackOverflow:

ionic serve does not load cordova plugins.

Auth0 uses auth0-cordova plugin which in turn requires:

  • cordova-plugin-safariviewcontroller
  • cordova-plugin-customurlscheme

All these require you to run the ionic app in your device or emulator if you want to test the login functionality.