Closed aguycalled closed 2 years ago
Have you introspected to see whether you are getting a global indexedDB
object after setGlobalVars
and before your use of Dexie?
const setGlobalVars = (await import("indexeddbshim")).default;
global.window = global;
setGlobalVars(global, { checkOrigin: false });
if (!window.indexedDB) {
console.log("No indexedDB!");
} else {
console.log(window.indexedDB);
}
outputs:
IDBFactory {
__connections: {},
__useShim: [Function (anonymous)],
__debug: [Function (anonymous)],
__setConfig: [Function: setConfig],
__getConfig: [Function (anonymous)],
__setUnicodeIdentifiers: [Function (anonymous)],
__openDatabase: [Function: bound ],
[Symbol(Symbol.toStringTag)]: 'IDBFactory'
}
DatabaseClosed error: MissingAPIError IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb
Ok, well, it looks fine on our end. It sounds your loading of this file may not be loading in time for Dexie. I think you'll want to raise this question over there (or on a support site like Stackoverflow). Closing as that should resolve, but feel free to comment further if really needed.
Trying
Gives me this error:
Dexie version: 3.2.0 indexedDBshim version: 8.0.0
Any clue?