Uncaught (in promise) TypeError: Cannot read property 'NON_INDEXED_FIELDS' of undefined
I'm using electron, dexie, and dexie-encrypted. After building the electron app I get the above error.
I'm importing like so:
import Dexie from "dexie";
import encrypt from "dexie-encrypted";
And my code is as follows:
encrypt(db, idbKey, {
certStore: encrypt.NON_INDEXED_FIELDS,
});
Is it something to do with the way I am importing dexie-encrypted? Any help would be appreciative
What version of dexie-encrypted are you using?
Hey, I am getting the same error (dexie-encrypted v2.0.0) . Dexie-encrypted v1.2.2 was working ok for me but has the bug/error described in #14 .
I am working with vue cli like that:
import Dexie from 'dexie'
import 'dexie-observable';
import encrypt from 'dexie-encrypted';
const db = new Dexie('tagebuchDB')
const binary_string = atob("_______________________________________");
const len = binary_string.length;
const cryptoKey = new Uint8Array(len);
for (var i = 0; i < len; i++) {
cryptoKey[i] = binary_string.charCodeAt(i);
}
encrypt(db, cryptoKey, {
tagebuchData: encrypt.NON_INDEXED_FIELDS,
});
db.version(1).stores({
tagebuchData: "$$id, date, content, starred"
})
export default db
Thank you very much!
import { cryptoOptions} from 'dexie-encrypted';
encrypt(db, cryptoKey, { tagebuchData: cryptoOptions.NON_INDEXED_FIELDS });
use this
I am also attaching working example check out https://codesandbox.io/s/dexie-encrypted-working-example-2hiqu?file=/db.js