jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.29k stars 353 forks source link

Failed to execute 'transaction' on 'IDBDatabase #182

Closed pinal-r closed 3 years ago

pinal-r commented 4 years ago

Unhandled Rejection (NotFoundError): Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.

Facing this error. My code is

const DB_NAME=`language_${window.localStorage.getItem('accountcode') || 0}`;
const langDB=openDB('abs2anguage', 1, {
    upgrade(db) {
        db.createObjectStore(DB_NAME);
    },
});
aman8604 commented 3 years ago

I am also facing the same issue

jakearchibald commented 3 years ago

In the code example above, DB_NAME is used as the store name, which is weird. It means that the store name could change without changing the schema version of the database. If that happens, you'll try to get an object store that was never created.

jakearchibald commented 3 years ago

If that isn't the issue, please create a minimal reproducible example of the issue, and I'll take a look.

isaacdarcilla commented 1 year ago

Got the same issue.

jakearchibald commented 1 year ago

@isaacdarcilla Please create a minimal reproducible example of the issue, and I'll take a look.

isaacdarcilla commented 1 year ago

It's working now.