-
Notifications
You must be signed in to change notification settings - Fork 35
Undefined is not an object #4
Comments
Note that this should not be |
I tried it but still getting the same error.. "undefined is not an object (evalutating cordova.sqlitePlugin.openDatabase)" |
Looks like the case is incorrect - it seems to be called |
I saw that it's write like that in the plugin file too so I tried it and It's a little bit better, now in the error message I can find the parameter that I passed on the function call : "undefined is not an object (evalutating cordova.SQLitePlugin.openDatabase({name:"my.db",location:1})" I also tried to call another function but I'm get the same kind of message |
Do you have a sample app that I could try ? |
I just wrote a very little example. https://github.com/Spierki/ReactNative-SQlite-Example |
I can't seem to figure out how to pass a function call. I've been trying to use the camera plugin and tried many ways, 4 of which are as follows.
Can you point out what I'm doing wrong? further I've defined itWorked and itFailed as functions, but they don't seem to get called:
|
@nikkool |
@axemclion did you tried my code ? |
@Spierki I looked at your code and figured out what the issue is. Note that I am using the latest version of the sqlite plugin, and react-native-cordova-plugin@0.0.7 This issue is that the SQlitePlugin does not export the object. It simply assigns it to A way to fix it would be to modify the SQLitePlugin here and add a line that says |
I plan to close this issue in a couple of days. If you are not able to get it working, please respond to this thread, and we can look to see if there are other issues. |
For sqlite, I recommend that you use https://github.com/andpor/react-native-sqlite-storage. I cannot promise when storesafe/cordova-sqlite-storage#382 will be fixed. @axemclion I recommend that you close this since the functionality is already supported by andpor / react-native-sqlite-storage. |
@brodybits Sounds good - thanks. Closing this issue. |
@axemclion I tried what you said and it's working thank you ! @brodybits The plugin you said looks like to be functionnal, thanks too. |
Hello,
first thank you for your job, it's amazing to use cordova plugin directly in React !
I followed your tutorial and I'm able to use the barcodescanner.
But now, I'm trying to use de sqlite plugin : https://github.com/litehelpers/Cordova-sqlite-storage
I added the plugin but when I try to use it I have this error : undefined is not an objet (evaluating 'cordova.window.sqlitePlugin').
This is my piece of code :
var cordova = require('react-native-cordova-plugin');
class Database {
openDb() {
cordova.window.sqlitePlugin.openDatabase({name: "my.db", location: 2});
}
}
Thanks in advance,
Florian
The text was updated successfully, but these errors were encountered: