我在公共环境中收到此错误日志,在大约 0.1% 的会话中非常一致。
我正在使用 Dexie。 https://dexie.org/
class DexieDB extends Dexie {
cacheData!: Table<CacheData>;
private static instance: DexieDB;
private constructor() {
super('DexieDB');
const store = { ...cacheDataSchema };
this.version(2).stores(store);
}
public static get Instance(): DexieDB {
if (!this.instance) {
this.instance = new this();
// Open the database
** this.instance.open().catch((e) => {**
logOpenDBFailed(e);
});
}
return this.instance;
}
}
export const dexieDB = DexieDB.Instance;
粗体行抛出此异常。我在 Google 搜索上没有找到任何令人满意的重现步骤或此异常的原因。如果有人有任何信息或指示,请告诉我。我不知道如何重现这个问题。预先感谢!
尝试找到重现步骤,但没有任何运气。 根据谷歌搜索,我看到了这篇文章https://jasonsavard.com/forum/discussion/4233/unknownerror-internal-error-opening-backing-store-for-indexeddb-open 但在我的场景中,这里提到的所有原因听起来都不合理。大多数崩溃发生在 Windows 机器上
在私有模式下运行 Firefox 时,对 Dexie open() 的调用将会失败,因为它不支持私有模式下的 indexedDB。除在私有模式下支持 IndexedDB 之外的所有其他浏览器均将数据视为私有会话的临时数据。难道是这个原因?
发生在我的 chrome(Mac 上)中。强制退出chrome或重新启动Mac即可解决问题
所以我也面临这个错误,我观看视频和文章等确实花了很多时间。但经过大量研究,我找到了解决方案,这就是解决方案。
答案:您必须清除浏览器中的缓存和 Cookie,以便轻松排除此错误。