Closed aaron-schmidt closed 9 years ago
Using non-minified Dexie.js:
message: "TypeError: undefined is not an object (evaluating 'indexedDB.getDatabaseNames')", line: 3152
Potential fix for line 3152:
var fn = indexedDB && (indexedDB.getDatabaseNames || indexedDB.webkitGetDatabaseNames);
Thanks for reporting. It seems that the system you run it on does not have indexedDB at all. Could that be the case? If so, you would need to include the IndexedDBShim before including Dexie.js.
Yes, neither iOS UIWebView nor Safari on Windows has an indexedDB object in the DOM. But in these cases (and others), I'd expect Dexie to fail silently not throw an exception. Our system is designed to fallback to using LocalStorage if IndexedDB does not exist. It should be a choice to include the IndexedDBShim versus a requirement.
Ok. I agree it would be better with at least a more explaining exception, and maybe a promise rejection when calling open.
Sounds good to me. Appreciate the quick response.
I got an error with 1.0.4 too. Could not instatiate Dexie. The error does not occur when reverting back to 1.0.3 with bower.
Your suggestion made Dexie behave as before, namely to return a rejected Promise from db.open() and not throw TypeError on new Dexie().
Will be part of next release.
Dexie v1.0.4
Error occurs the moment Dexie is instantiated: var dex = new Dexie('project-db');
Error occurs in: iOS WebView (UIWebView) Safari 5.1.7 on Windows 8.1: "TypeError: 'undefined' is not an object".