Comments (5)
it maybe related to this safari issue:
https://bugs.webkit.org/show_bug.cgi?id=136937
and its caused by:
Dexie (line 537):
adjustToExistingIndexNames(globalSchema, idbdb.transaction(idbdb.objectStoreNames, READONLY));
from dexie.js.
As outlined in https://bugs.webkit.org/show_bug.cgi?id=136937 this is only an issue on iOS if multiple stores are passed to idbdb.transaction().
The following change will remove the error on iOS but only if the database contains a single store. Databases with multiple stores will still throw an error.
Change (~ line 531):
else if (idbdb.objectStoreNames.length > 0)
adjustToExistingIndexNames(globalSchema, idbdb.transaction(idbdb.objectStoreNames, READONLY));
To:
else if (idbdb.objectStoreNames.length > 0) {
var storeNamesHack = idbdb.objectStoreNames.length > 1 ? idbdb.objectStoreNames : idbdb.objectStoreNames.item(0);
adjustToExistingIndexNames(globalSchema, idbdb.transaction(storeNamesHack, READONLY));
}
Note that using an array that contains a single value will also work:
else if (idbdb.objectStoreNames.length > 0) {
var storeNamesHack = idbdb.objectStoreNames.length > 1 ? idbdb.objectStoreNames : [idbdb.objectStoreNames.item(0)];
adjustToExistingIndexNames(globalSchema, idbdb.transaction(storeNamesHack, READONLY));
}
Edit: Changed .item() to .item(0)
from dexie.js.
Seems like you've found a new IndexedDB bug in iOS 8. Could you provide a live example and file a bug on WebKit? :)
from dexie.js.
Oh nevermind, I see that this IS the same bug. What you're saying is that there's a workaround. (If there's only one store, open using 'databasename'
rather than ['databasename']
.)
I made a live test case anyway, just for kicks: http://bl.ocks.org/nolanlawson/1d407ac013d92bf998cb
from dexie.js.
Solved. See comments on
this commit
from dexie.js.
Related Issues (20)
- Error: Unable to delete database because it's blocked HOT 10
- Failed to sync: trying to use public realm HOT 7
- Failed to execute 'createObjectStore' on 'IDBDatabase': The keyPath option is not a valid key path. HOT 7
- useLiveQuery not re-rendering React Component HOT 6
- It would be good to include options example to TS docs
- Is it possible to lock the DB and add a pending action queue? HOT 7
- Can I use a `for await...` loop inside a transaction? HOT 3
- Large initial data insertion is slower with Observable enabled HOT 1
- Is it possible to do a Case Insensitve .between()? HOT 3
- Claim not to support with typeScript 3.5.1? HOT 2
- Is it possible to use Dexie inside a Service Worker? HOT 1
- Is it possible to check which records have been updated when `liveQuery` runs? HOT 16
- indexedDB存储报告异常 HOT 3
- AbortError HOT 1
- Why does deleting not take into effect with cached liveQuery()? HOT 3
- modify doesn't work HOT 1
- ReferenceError: Can't find variable: indexedDB with PlayStation
- Populate. async callback. Transaction doesn't work
- How to add AddOns to a TypeScript Dexie DB?
- Can not disable Dexie.debug on prod HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexie.js.