angular2-indexeddb icon indicating copy to clipboard operation
angular2-indexeddb copied to clipboard

Edge not allowing add method

Open StudioKodeMike opened this issue 7 years ago • 7 comments

I've been trying to use add() to insert into the DB but I get a [object DOMException]: {code:0, message:"DataError", name:"DataError"} exception every time its called.

I saw a previous issue that looks the same but is closed, it suggested adding in the key but that hasn't worked for me. This is happening with the current version of Edge on windows and on Windows Phone.

StudioKodeMike avatar Feb 08 '18 16:02 StudioKodeMike

Yes. Even i am facing the same issue. Also in internet explorer. idberror

ashwinimendon avatar Feb 13 '18 03:02 ashwinimendon

@StudioKodeMike and @ashwinimendon,

How did you config the objectStore's key? Is it configured to autoIncrement (which isn't the default configuration)? If not, check the key configuration or the key type that you are passing to the add function.

Let me know if that solves your problem.

gilf avatar Feb 13 '18 06:02 gilf

@gilf I'm not using autoincrement as the objects all have id's from the rest api I'm pulling them from.

I set the keyPath to whatever that it called in the api so that the objects can be organised the way they are in the backend.

By the time it get through Angular and into the database its a number taken from a JSON object.

StudioKodeMike avatar Feb 13 '18 08:02 StudioKodeMike

This works fine in Chrome and Firefox but the update function throws an DataError in IE and Edge

DataService.db = new AngularIndexedDB('DB', 1); DataService.db.openDatabase(1, (evt) => { evt.currentTarget.result.createObjectStore( 'userTasks', { keyPath: 'id', autoIncrement: false }); })

DataService.db.update('userTasks', {id: 1, name: SomeTask, user: 123})

kaspern88 avatar Feb 14 '18 11:02 kaspern88

Same problem here :( A working example for Edge would be really great

JensSchliesser avatar Apr 10 '18 07:04 JensSchliesser

Problem still persists on IE. I've tried the add method with and without the key parameter, but there's no way to have a value added to indexedDB. Does a working example exist somewhere?

JinKanzaki90 avatar Sep 25 '18 12:09 JinKanzaki90

We had this issue in IE11 and Edge. Installing the latest windows updates solved the issue (Windows 10).

philipobriensgs avatar Oct 09 '18 15:10 philipobriensgs