I have Cordova 3.5.0 installed and the latest Ionic (1.0.14 from npm) and I’m getting a number of errors:
[Error] Deprecated attempt to access property 'userAgent' on a non-Navigator object. invoke (ionic.bundle.js, line 12639) [Error] Deprecated attempt to access property 'platform' on a non-Navigator object. platform (ionic.bundle.js, line 2158) [Error] Deprecated attempt to access property 'geolocation' on a non-Navigator object. (anonymous function) (cordova.js, line 1221) [Error] Deprecated attempt to access property 'geolocation' on a non-Navigator object. assignOrWrapInDeprecateGetter (cordova.js, line 484) [Error] Deprecated attempt to access property 'userAgent' on a non-Navigator object. (anonymous function) (statusbar.js, line 27) [Error] TypeError: undefined is not an object (evaluating 'navigator.userAgent.indexOf') require (cordova.js, line 71) [Error] Deprecated attempt to access property 'userAgent' on a non-Navigator object. main (main.js, line 54) [Log] deviceready has not fired after 5 seconds. (console-via-logger.js, line 173) [Log] Channel not fired: onCordovaReady (console-via-logger.js, line 173) [Log] Channel not fired: onCordovaInfoReady (console-via-logger.js, line 173) [Log] Channel not fired: onCordovaConnectionReady (console-via-logger.js, line 173)
I only see the errors referencing ionic.bundle.js and cordova.js. These errors occur in the browser when I run them off cordova serve but not when I run python -m SimpleHTTPServer 8000. They also occur when I run a build and test on my device with Xcode.
Woah thats crazy, I haven’t seen those before. Can you provide the steps you took and got this? Or could you try making a new project with our CLI and see if this happens?
Then in Xcode, I opened up the new project and ran the app using my actual iPhone as the emulator. Once the app was running, I used Safari’s Web Inspector to view my console and saw this:
[Error] Deprecated attempt to access property 'userAgent' on a non-Navigator object. invoke (ionic.bundle.js, line 12639) [Error] Deprecated attempt to access property 'userAgent' on a non-Navigator object. getInfo (device.js, line 74) [Error] TypeError: undefined is not an object (evaluating 'navigator.userAgent.indexOf') iOSExec (cordova.js, line 924) [Log] deviceready has not fired after 5 seconds. (console-via-logger.js, line 173) [Log] Channel not fired: onCordovaInfoReady (console-via-logger.js, line 173)
The test app seems to navigate around properly but on my app that I’m working on, I need to do some geolocation and other things that require me to wait until plugins are loaded and ready() before I can fire off some functionality that I wrote to look up location, set some sort preferences, etc.
If you would like to view my project code, feel free since what I am working on is supposed to be released open source:
Make sure you look at the branch ‘switching-api-service’ - I’m still in the process here of re-wiring up my app to work with the API service I am building but that’s the latest.
Same error to report here! Deprecated attempt to access property 'userAgent' on a non-Navigator object.. I’m using Ember and Cordova in my project (not sure about OP), so I thought one of those might be the cause of this error, but a Google Search took me here so now I’m thinking it’s my use of Ionicons. OP, did you find a fix?