0

Question from a newbie. I'm using the IDB library. I already had a working version of my storage (on localhost), but the changes uploaded to dev do not work properly on it.

An error appeared: ERROR DOMException: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.

I checked in the browser tools. Indeed, the thumbnails storage section was created, but the storage itself named 'thumbnails' was not created. I deleted on the localhost thumbnails storage and without changing the code tried to create it anew. I received the same problem.

Why can't I create storage?

My code:

//function called in app module using APP_INITIALIZER 
export function initIndexedDB(): () => void {
  return () => {
    return createDB();
  }
}

function createDB(): void {
  openDB(IdbType.ThumbnailsStorage, IdbVersion.One, {
    upgrade(db: IDBPDatabase<IIdbThumbnailsStorage>) {
      db.createObjectStore(StorageType.Thumbnails, {keyPath: IdbKeypath.Id});
    }
  });
}

Well, and of course, I tried without typing.

kampai35
  • 11
  • 2

0 Answers0