DexieJS and Electron

591 views
Skip to first unread message

dej...@gmail.com

unread,
Jun 4, 2016, 8:55:12 PM6/4/16
to Dexie.js
Hi,

I am having some trouble to use DexieJS inside an Electron desktop application.
The chrome version that is running is 51.0.2704.63

So my question is, does Dexie.js support Electron?
Or it doesn't currently support Electron?


I installed Dexie via npm locally, the problem happens when I try to open the database, with the following error:
MissingAPIError: indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using Safari, make sure to include indexedDB polyfill.

I tried installing indexeddb and indexeddbshim through npm, tried requiring before initializing Dexie. Tried isolating my Dexie.js usage to a single file (to make sure I wasn't screwing up on different scopes and execution threads).

Thank you!

[code]
const Dexie = require ('dexie');
var db = new Dexie('DBName');

db.open().catch(function (e) {
console.error("Open failed: " + e);
});
[/code]
>> Open failed: MissingAPIError: indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using Safari, make sure to include indexedDB polyfill.

dej...@gmail.com

unread,
Jun 4, 2016, 8:57:10 PM6/4/16
to Dexie.js, dej...@gmail.com
My package.json deps:
"dependencies": {
"angular": "^1.5.6",
"angular-animate": "^1.5.6",
"angular-aria": "^1.5.6",
"angular-material": "^1.1.0-rc.5",
"dexie": "^1.3.6",
"indexeddbshim": "^2.2.1"
},
"devDependencies": {}

David Fahlander

unread,
Jun 7, 2016, 5:05:27 AM6/7/16
to Dexie.js, dej...@gmail.com
Electron separates main process from rendering process. Include dexie from you HTML page where you have all the DOM api, including indexedDB.

dej...@gmail.com

unread,
Jun 7, 2016, 10:34:44 PM6/7/16
to Dexie.js, dej...@gmail.com
Reply all
Reply to author
Forward
0 new messages