Dexie.js: InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing with ios safari
I am getting error on log when this get executed:-
import React, { useEffect } from "react";
import db from "../config/db";
useEffect(() => {
db.reads
.get(props.match.params.id)
.then((data) => {})
.catch((e) => {
console.log(e);
});
}, []);
import Dexie from "dexie";
const db = new Dexie("bookDB");
db.version(2).stores({
reads: "hash,token,sa,ss",
books: "hash,token",
});
export default db;
I am getting many errors :-
InvalidStateError: Failed to execute ‘transaction’ on ‘IDBDatabase’: The database connection is closing.
UserAgent:-
Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Mobile/15E148 Safari/604.1
I could not find steps that produce the following error, some iPhone’s i’ve tested does not return any error.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16
Thanks @quolpr! Yes, that would be great if we could workaround this. I posted an idea on how to fix it Based on mikekreeki’s workaround but without having to test IDB state for every request.
It seems indeed to workaround the issue pretty well! Thank you!