Skip to content

ReferenceError: cordova is not defined in  #30

@rsa408

Description

@rsa408

Hi,
Thank you for your code sharing but I got falowing error for : Cordova-Examples/securestorage_ionicnative/app/pages/home/home.ts in run time
ReferenceError: cordova is not defined

    at securestorage.js:57
    at new t (polyfills.js:3)
    at SecureStorage.create (securestorage.js:56)
    at home.ts:28
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (ng_zone.js:236)
    at t.invoke (polyfills.js:3)
    at e.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)

and fallowing for data input and login button click:

Object {success: 0}
plugin.js:33 Native: tried calling Dialogs.alert, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordovaWarn @ plugin.js:33
callCordovaPlugin @ plugin.js:112
(anonymous) @ plugin.js:160
(anonymous) @ plugin.js:132
t @ polyfills.js:3
tryNativePromise @ plugin.js:131
getPromise @ plugin.js:153
wrapPromise @ plugin.js:159
(anonymous) @ plugin.js:326
value @ plugin.js:387
(anonymous) @ home.ts:79
SafeSubscriber.__tryOrSetError @ Subscriber.js:232
SafeSubscriber.next @ Subscriber.js:174
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
ArrayObservable._subscribe @ ArrayObservable.js:114
Observable.subscribe @ Observable.js:56
HomePage.login @ home.ts:58
View_HomePage0.handleEvent_35 @ component.ngfactory.js:507
(anonymous) @ view.js:408
(anonymous) @ dom_renderer.js:276
t.invokeTask @ polyfills.js:3
onInvokeTask @ ng_zone.js:227
t.invokeTask @ polyfills.js:3
e.runTask @ polyfills.js:3
invoke @ polyfills.js:3
error_handler.js:47 EXCEPTION: Uncaught (in promise): TypeError: Cannot read property 'remove' of undefined
TypeError: Cannot read property 'remove' of undefined
    at callInstance (http://localhost:8100/build/main.js:542:37)
    at http://localhost:8100/build/main.js:580:17
    at http://localhost:8100/build/main.js:466:17
    at new t (http://localhost:8100/build/polyfills.js:3:11329)
    at tryNativePromise (http://localhost:8100/build/main.js:465:20)
    at getPromise (http://localhost:8100/build/main.js:487:16)
    at SecureStorage.<anonymous> (http://localhost:8100/build/main.js:579:20)
    at SecureStorage.value [as remove] (http://localhost:8100/build/main.js:740:61)
    at SafeSubscriber._next (http://localhost:8100/build/main.js:55171:37)
    at SafeSubscriber.__tryOrSetError (http://localhost:8100/build/main.js:1284:16)
ErrorHandler.handleError @ error_handler.js:47
IonicErrorHandler.handleError @ ionic-error-handler.js:56
next @ application_ref.js:272
schedulerFn @ async.js:82
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:74
NgZone.triggerError @ ng_zone.js:278
onHandleError @ ng_zone.js:257
t.handleError @ polyfills.js:3
e.runGuarded @ polyfills.js:3
r @ polyfills.js:3
i @ polyfills.js:3
invoke @ polyfills.js:3
error_handler.js:52 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ error_handler.js:52
IonicErrorHandler.handleError @ ionic-error-handler.js:56
next @ application_ref.js:272
schedulerFn @ async.js:82
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:74
NgZone.triggerError @ ng_zone.js:278
onHandleError @ ng_zone.js:257
t.handleError @ polyfills.js:3
e.runGuarded @ polyfills.js:3
r @ polyfills.js:3
i @ polyfills.js:3
invoke @ polyfills.js:3
error_handler.js:53 Error: Uncaught (in promise): TypeError: Cannot read property 'remove' of undefined
TypeError: Cannot read property 'remove' of undefined
    at callInstance (plugin.js:208)
    at plugin.js:246
    at plugin.js:132
    at new t (polyfills.js:3)
    at tryNativePromise (plugin.js:131)
    at getPromise (plugin.js:153)
    at SecureStorage.<anonymous> (plugin.js:245)
    at SecureStorage.value [as remove] (plugin.js:406)
    at SafeSubscriber._next (home.ts:80)
    at SafeSubscriber.__tryOrSetError (Subscriber.js:232)
    at s (polyfills.js:3)
    at new t (polyfills.js:3)
    at tryNativePromise (plugin.js:131)
    at getPromise (plugin.js:153)
    at SecureStorage.<anonymous> (plugin.js:245)
    at SecureStorage.value [as remove] (plugin.js:406)
    at SafeSubscriber._next (home.ts:80)
    at SafeSubscriber.__tryOrSetError (Subscriber.js:232)
    at SafeSubscriber.next (Subscriber.js:174)
    at Subscriber._next (Subscriber.js:125)

how ever it return 0 for login but it is not going to main-page also I am using the fallowings:

Ionic Framework: 2.0.0-rc.4
Ionic Native: 2.2.11
Ionic App Scripts: 0.0.47
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.9.1
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Mobile Safari/537.36

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions