I am creating a Desktop app(Electron) with Ionic4 for windows 10 with sqlitedb (OFFLINE DB) but I am not able to create db.
Whenever I call createdb, it is throwing “ERROR Error: Uncaught (in promise): TypeError: Cannot read property ‘then’ of undefined”.
Here is the code snippet –
this.sqlite.create({
name: 'data.db',
location: 'default'
})
.then((db: SQLiteObject) => {
db.executeSql('create table danceMoves(name VARCHAR(32))', [])
.then(() => console.log('Executed SQL'))
.catch(e => console.log(e));
})
.catch(e => console.log(e));
I am using sqlite plugin version -
“cordova-sqlite-storage”: “^5.0.1”,
NOTE - Same code is working fine on Android and iOS device.